My web application uses correctly slf4j, but I have a method that generates a considerable amount of log, so I would like this method to have its own logger to write on a separate file, or tell the main logger to write to a different file.
How could I accomplish that?
This is my log4j.properties:
################################################################################
#### Configurazione log root
################################################################################
log4j.rootCategory=debug, stdout, file
log4j.category.org.apache=info
log4j.category.org.hibernate=info
log4j.category.com.mchange=warn
log4j.category.org.springframework=info
################################################################################
#### Appender per console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss} - %-5p - (%F:%L) - %m%n
################################################################################
#### Appender su file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=pathToLog.log
log4j.appender.file.MaxFileSize=5000KB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss} - %-5p - (%F:%L) - %m%n
Thanks in advance