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
  • 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](https://logback.qos.ch/manual/filters.html) 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. – CryptoFool Mar 07 '22 at 16:46
  • Does this answer your question? [How to configure log4j to log different log levels to different files for the same logger](https://stackoverflow.com/questions/1839647/how-to-configure-log4j-to-log-different-log-levels-to-different-files-for-the-sa) – pringi Mar 07 '22 at 17:26

0 Answers0