tinylog 2如何写一行日志?
How to write one-line logs with tinylog 2?
我正在使用 https://tinylog.org/v2/ 进行日志记录。
默认情况下,框架将每条语句记录为两行
2020-10-25 20:07:27 [main] org.reflections.Reflections.scan()
INFO: Reflections took 288 ms to scan 1 urls, producing 5 keys and 22 values
如何避免这种行为?首选解决方案是程序化的
您可以通过 Configuration class 以编程方式为您的日志条目设置格式模式。
示例:
Configuration.set("writer", "console");
Configuration.set("writer.format", "{date} [{thread}] {class}.{method}() {level}: {message}");
我正在使用 https://tinylog.org/v2/ 进行日志记录。
默认情况下,框架将每条语句记录为两行
2020-10-25 20:07:27 [main] org.reflections.Reflections.scan()
INFO: Reflections took 288 ms to scan 1 urls, producing 5 keys and 22 values
如何避免这种行为?首选解决方案是程序化的
您可以通过 Configuration class 以编程方式为您的日志条目设置格式模式。
示例:
Configuration.set("writer", "console");
Configuration.set("writer.format", "{date} [{thread}] {class}.{method}() {level}: {message}");