multiple log files with different log levels
See original GitHub issueIs it possible for a log message to appear in multiple log files with depending on their configurations?
For example I’d like all log messages to go to my main log file myapp.log
and only the error messages to go to error.log
?
Can I specify multiple file transports, like this?
log.transports.file1
log.transports.file2
or
log.transports.file.1
log.transports.file.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Different level of logs in different log files - Stack Overflow
Finally got the answer by doing this i got the logs in different files. <Loggers> <logger name="com.mvc.login" level="info" ...
Read more >How to write logs into separate files based on log levels
Logs can be written into separate files based on the log level. Example: ERROR logs into error.log, WARN logs into warn.log etc.
Read more >SLF4J: Different Log Files for Different Log Levels - MBcoder
Configuring the SLF4J(Simple Logging Facade for Java) and LOGBack to create different log files for different log levels.
Read more >Log4j – Custom Log Levels - Apache Logging Services
Custom log levels can be defined in code or in configuration. To define a custom log level in code, use the Level.forName() method....
Read more >Configure log4net to log to two different log files
Configure log4net to log to two different log files · Method 1: Using two named loggers · Method 2: Using root logger and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, great. Thanks for creating, maintaining and improving this project.
There is no straightforward way. You can write a custom hook which changes log.transports.file.file depending on a message level.