One of the annoying things with log4j is that he always wants to dump stuff onto the screen. I do not need this if I register a file. I am sure that I have installed the log4j.properties file. Eliminating all of these configuration materials is disappointing! :-)
For the program that I am invoking Balancer, I am initializing my registrar. Perhaps this is wrong or something like that.
static Logger log = Logger.getLogger(Balancer.class);
Partial dump of my log4j.properties:
log4j.rootLogger=fatal, stdout log4j.logger.Balancer=fatal, rollingLog # I still don't understand how category stuff works yet log4j.category.Balancer=info, BalancerLog #### First appender writes to console log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p %d [%t] (%F:%L) - %m%n #### Second appender writes to a file # Control the maximum log file size # Archive log files (ten backups here) log4j.appender.rollingLog=org.apache.log4j.RollingFileAppender log4j.appender.rollingLog.File=default.log log4j.appender.rollingLog.MaxFileSize=10000KB log4j.appender.rollingLog.MaxBackupIndex=10 log4j.appender.rollingLog.layout=org.apache.log4j.PatternLayout log4j.appender.rollingLog.layout.ConversionPattern=%5p %d [%t] (%F:%L) - %m%n log4j.appender.BalancerLog=org.apache.log4j.RollingFileAppender log4j.appender.BalancerLog.File=Balancer.log log4j.appender.BalancerLog.MaxFileSize=100000KB log4j.appender.BalancerLog.MaxBackupIndex=10 log4j.appender.BalancerLog.layout=org.apache.log4j.PatternLayout log4j.appender.BalancerLog.layout.ConversionPattern=%5p %d [%t] (%F:%L) - %m%n
I get how rootLogger sends stuff to appdd. Is there a / dev / null appender? You must have at least one application.
In any case, if nothing else, my main job now is to send the screen output to / dev / null. BTW, my Java programs run in a planned batch environment (no GUI). The reason for clearing buffered files (yes, this is on AS / 400) is a bit of a pain, although it can also be automated.
source share