Log4j 1.x was declared End of Life in August 2015 (https://blogs.apache.org/foundation/entry/apache_logging_services_project_announces). Also, Log4j 1.2 is known to be broken on Java 9 (https://blogs.apache.org/logging/entry/moving_on_to_log4j_2).
Other than that, the people in this community have been focused on Log4j2 for several years and I actually don't think there is anyone here with Log4j 1.x expertise. If you're willing to migrate to Log4j2 we may be able to help. Remko > On Oct 10, 2017, at 4:28, Shawn Heisey <apa...@elyograg.org> wrote: > > Solr is an Apache project that uses slf4j, with log4j 1.2 as the final > logging destination. > > In one of the classes in Solr, specifically the SolrCore class, these > are the loggers defined: > > private static final Logger log = > LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); > public static final Logger requestLog = > LoggerFactory.getLogger(MethodHandles.lookup().lookupClass().getName() + > ".Request"); > > I would like to define an additional logger like this: > > private static final Logger slowLog = > LoggerFactory.getLogger(MethodHandles.lookup().lookupClass().getName() + > ".SlowRequest"); > > Between the lines below is the log4j.properties file that Solr includes > out of the box: > > ============== > # Default Solr log4j config > # rootLogger log level may be programmatically overridden by > -Dsolr.log.level > solr.log=${solr.log.dir} > log4j.rootLogger=INFO, file, CONSOLE > > # Console appender will be programmatically disabled when Solr is > started with option -Dsolr.log.muteconsole > log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender > log4j.appender.CONSOLE.layout=org.apache.log4j.EnhancedPatternLayout > log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd > HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] > %c{1.} %m%n > > #- size rotation with log cleanup. > log4j.appender.file=org.apache.log4j.RollingFileAppender > log4j.appender.file.MaxFileSize=4MB > log4j.appender.file.MaxBackupIndex=9 > > #- File to log to and log format > log4j.appender.file.File=${solr.log}/solr.log > log4j.appender.file.layout=org.apache.log4j.EnhancedPatternLayout > log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} > %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n > > # Adjust logging levels that should differ from root logger > log4j.logger.org.apache.zookeeper=WARN > log4j.logger.org.apache.hadoop=WARN > log4j.logger.org.eclipse.jetty=WARN > log4j.logger.org.eclipse.jetty.server.Server=INFO > log4j.logger.org.eclipse.jetty.server.ServerConnector=INFO > > # set to INFO to enable infostream log messages > log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF > ============== > > I would like to add some commented out lines to the stock properties > file which will allow a user to uncomment the lines to enable a separate > "slow query" logfile. The full logger name would be > org.apache.solr.core.SolrCore.SlowRequest for these logs. In addition to > directing logs for this logger (which will be at the WARN level) to the > separate file, the commented config should *remove* those lines from the > main solr.log file, if that is possible. > > I have not been able to determine what configuration would produce these > results. Can this list help? One thing I have considered is converting > to the XML config format, but I have not been able to locate any > resources for making that conversion. > > Thanks, > Shawn > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org > For additional commands, e-mail: log4j-user-h...@logging.apache.org >