top-image

Tag archives for path

CSharp/C# : Get the source folder path of CSharp class
Hi, Here, an example to get the source folder path of CSharp class via a static method and the package System.Runtime.CompilerServices. In fact, we solicit the compiler in order to get some informations about caller (caller line number, caller method, caller file path): https://msdn.microsoft.com/fr-fr/library/system.runtime.compilerservices.callermembernameattribute(v=vs.110).aspx.   ...in the caller method, for example a simple Program.cs, some parameters Callerxxxx are set by compiler: That's all!!!! Huseyin ...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. MainApp.java Config.properties BUSINESS_LOG_FILE=D\:\\...\\... \\data\\results\\InjectorBusiness.log TECHNICAL_LOG_FILE=D\:\\...\\...\\data\\results\\InjectorTechnical.log LogUtil.java log4jInjector.properties log4j.rootCategory=ALL,CONSOLE,TECHNICALLOGFILE log4j.logger.com.ho.log4j.test2.LogUtil=INFO,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»
bottom-img
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.