Tag archives for Log4j

Documentum : Diagnostic DFC configuration, localization log4j.propeties,
Hello, CLIENT SIDE Everybody has already been confronted with problem of localization of or files used on runtime. The DFC configuration files like and are located through the classpath found in WAR files and EAR files. More, for information, there are several possibilities to point to file: Include Statement A can contain an include statement pointing at the ...more»
Java : Log4j overwite the file path on runtime
Hi, After my previous posts concerning Java: Log4j Concepts and Explanations and Java: Log4j in practice, I would expose a solution to overwrite the file path on runtime. Libraries needed : commons-lang3-3.1.jar, commons-logging-1.1.1.jar and log4j-1.2.15.jar. BUSINESS_LOG_FILE=D\:\\...\\... \\data\\results\\InjectorBusiness.log TECHNICAL_LOG_FILE=D\:\\...\\...\\data\\results\\InjectorTechnical.log log4j.rootCategory=ALL,CONSOLE,TECHNICALLOGFILE,BUSINESSLOGFILE #------------------- CONSOLE -------------------------- log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern= %m%n log4j.appender.CONSOLE.Threshold=INFO #------------------- FILE -------------------------- log4j.appender.TECHNICALLOGFILE=org.apache.log4j.RollingFileAppender log4j.appender.TECHNICALLOGFILE.File=injectortech.log log4j.appender.TECHNICALLOGFILE.MaxFileSize=30MB log4j.appender.TECHNICALLOGFILE.layout=org.apache.log4j.PatternLayout log4j.appender.TECHNICALLOGFILE.layout.ConversionPattern=%d{ABSOLUTE} %5p %c - %m%n log4j.appender.TECHNICALLOGFILE.Threshold=ALL #------------------- BUSINESSLOGFILE -------------------------- log4j.appender.BUSINESSLOGFILE=org.apache.log4j.DailyRollingFileAppender #log4j.appender.BUSINESSLOGFILE.File=${catalina.base}/logs/Injector.log log4j.appender.BUSINESSLOGFILE.File=injector.log log4j.appender.BUSINESSLOGFILE.DatePattern='.'yyy-MM-dd-HH log4j.appender.BUSINESSLOGFILE.MaxFileSize=30MB log4j.appender.BUSINESSLOGFILE.layout=org.apache.log4j.PatternLayout log4j.appender.BUSINESSLOGFILE.Threshold=ALL log4j.appender.BUSINESSLOGFILE.Append=true log4j.appender.BUSINESSLOGFILE.layout.ConversionPattern=%-d{MMM dd HH:mm:ss} %-5p %c %M %m%n Execute the MainApp class with the following program ...more»
Java: Log4j in practice
Hi, After my post Java: Log4j Concepts and Explanations about Log4j concepts, I would introduce Log4j in practice through several concrets examples and their results. The section of this article will be: 1) Use of Log4j directly 2) Specifying granularity for external library or for custom package 3) Use of Log4j with a wrapper 4) Extended example with DailyRollingFileAppender 5) Use of environment variables in Log4J 6) Configure ...more»
Java: Log4j Concepts and Explanations
Hi, In this article, I would present the famous framework of logging Log4J which is used in the most projects. So, our article will be composed of several sections: 1) Presentation of logging and Log4J, 2) The components of Log4J, 3) Apache Commons Logging and SLF4J 1) Presentation of logging and Log4J The best practices of development recommend the use of a logging system instead of ...more»
Copyright ® 2012 Huseyin Ozveren. No reproduction, even partial, can be used from this site and all its contents including text, documents, images, etc.. without the express permission of the author.