0

These are the logging properties. I want to save errors in different file what changes are required?

#logging properties
logging.level.root=info
logging.level.com.bmo.ris=debug
logging.org.hibernate.SQL=debug

logging.file.path=C:\\log
logging.file.name=${logging.file.path}\\Logs.log
logging.file.max-size=20KB
logging.file.max-history=3
logging.pattern.file=%d{dd-MM-yyyy HH:mm:ss.SSS} %-5level %logger{36}.%M - %msg%n
logging.pattern.rolling-file-name=${logging.file.path}\\archived\\Logs_%d{dd-MM-yyyy}_%i.log
logging.pattern.console=%d{dd-MM-yyyy HH:mm:ss.SSS} %-5level %logger{36}.%M - %msg%n
2
  • I've done this sort of thing using Spring and Logback, but only by using a logback-spring.xml config file. Once you're doing that, you can create any number of Appenders each logging to a location, and you can apply specific filters to each of your Appenders. see this I don't know if this sort of thing is doable with Spring properties. I kinda can't see how that kind of complexity could be allowed for with just a flat property mechanism. My guess is that you need to go to using a logging config file. Commented Mar 7, 2022 at 16:46
  • Does this answer your question? How to configure log4j to log different log levels to different files for the same logger Commented Mar 7, 2022 at 17:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.