Let me try to explain the WSAS log4j.properties file 1. log4j.logger.org.hibernate=ERROR, WSO2WSAS_LOGFILE, WSO2WSAS_MEMORY
Above line defines that the org.hibernate logger has a level of ERROR and has two appenders, WSO2WSAS_LOGFILE & WSO2WSAS_MEMORY 2. # WSO2WSAS_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. log4j.appender.WSO2WSAS_LOGFILE=org.apache.log4j.DailyRollingFileAppender Above line defines that the appender WSO2WSAS_LOGFILE is of type org.apache.log4j.DailyRollingFileAppender 3. # WSO2WSAS_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. log4j.appender.WSO2WSAS_LOGFILE=org.apache.log4j.DailyRollingFileAppender # Log file will be overridden by the configuration setting in the DB # This path should be relative to WSO2 WSAS Home log4j.appender.WSO2WSAS_LOGFILE.File=logs/wso2wsas.log log4j.appender.WSO2WSAS_LOGFILE.Append=true log4j.appender.WSO2WSAS_LOGFILE.layout=org.apache.log4j.PatternLayout # ConversionPattern will be overridden by the configuration setting in the DB log4j.appender.WSO2WSAS_LOGFILE.layout.ConversionPattern=%5p [%d] %x %m%n log4j.appender.WSO2WSAS_LOGFILE.threshold=DEBUG Above lines define how the appender is configured. Notice that the threshold is debug. Note that for a log.debug/log.info/log.warn... to actually write something to the appender tow conditions must be met: a. The Log Level of the logger should not allow the log message through. e.g. if the log level of a logger is set to ERROR and you try to write an INFO message, it will not get written to the appender b. The Threshold of the appender should allow the log message through. e.g. say the log level of the logger is set to DEBUG and the threshold of an appender is set to ERROR. So if you try to write an INFO level message, it will not get written to this particular appender. -------------------------------------------------------------------------------------------------------------- In your case, you can define multiple loggers for each of your applications as shown in 1) above. Also define multiple appenders as shown in 2) and link them to your loggers as shown in 1). This way, each of your applications can write to different logfiles. Were you able to get your custom log file to be picked up by log4j? -- Azeez On Jan 23, 2008 3:31 AM, Sushil Dodake <[EMAIL PROTECTED]> wrote: > I tried the above options but doesnt seem to be woring. > from the following link, i want to kno how do you couple your logger with > the specific appender. > > https://wso2.org/repos/wso2/trunk/wsas/java/modules/core/conf/log4j.properties > i.e. if i want to log a stuff in one projkect to a log file then i > log4j.properties file i need to couple the logger of that project to the > specific appender. > how do u do that? > > > > > On Jan 19, 2008 11:52 AM, Afkham Azeez <[EMAIL PROTECTED]> wrote: > > > It has to be either at the top of your classpath or you have to point > > the System property log4j.configuration to your log4j.properties file. > > Since you are using Tomcat, you may set the CATALINA_OPTS system variable. > > i.e. > > > > On Linux, export CATALINA_OPTS=/home/azeez/log4j.configuration > > On Windows, CATALINA_OPTS=C:\azeez\log4j.configuration > > > > and then start Tomcat, > > > > $./catalina.sh run > > > > Azeez > > > > > > > > On Jan 19, 2008 10:48 PM, Sushil Dodake <[EMAIL PROTECTED]> wrote: > > > > > i m suppose to put the log4j.proprties file in classes or conf > > > folder.....? > > > > > > regards > > > > > > sushil > > > > > > On Jan 19, 2008 10:24 AM, Afkham Azeez <[EMAIL PROTECTED]> wrote: > > > > > > > Still you can have a single log4j configuration file which handles > > > > the logging configuration of all Web services. For each of the > > > > services, you > > > > can use a different logger, these 6 loggers can write to 6 different > > > > files. > > > > You will need 6 different file appenders and each of these will point > > > > to a > > > > separate log file. The 6 loggers will use one each of these appenders. > > > > Here > > > > is a sample file from WSAS ( > > > > https://wso2.org/repos/wso2/trunk/wsas/java/modules/core/conf/log4j.properties). > > > > Here we have used 2 different log files which are associated with 2 > > > > different appenders. Take a look at how the loggers & appenders have > > > > been > > > > configured. > > > > > > > > Azeez > > > > > > > > > > > > On Jan 19, 2008 9:39 PM, Sushil Dodake <[EMAIL PROTECTED]> > > > > wrote: > > > > > > > > > Azeez, > > > > > my problem is my application has 6 web services and i need to have > > > > > the loggs of each web service in diffrent log file. > > > > > currently in development box they all are deployed in a singel > > > > > tomcat. > > > > > also the problem is on console the DEBUG does not appear... while > > > > > if i make it to INFO then that appears.... but loggs cannot be > > > > > directed in a > > > > > .log file.... > > > > > any help on this? > > > > > > > > > > regards, > > > > > > > > > > sushil > > > > > > > > > > On Jan 19, 2008 9:45 AM, Afkham Azeez <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > Most probably the reason for this is that the system is picking > > > > > > up another log4j.properties file. Hence your changes are not > > > > > > taking effect. You should set the log4j.configuration system > > > > > > property to point to your file using one of the following methods: > > > > > > 1. in code, System.setProperty("log4j.configuration", > > > > > > "C:\\axis2\\con\\log4j.properties"); > > > > > > 2. -Dlog4j.configuration=C:\axis2\conf\log4j.properties in the > > > > > > bat or sh file > > > > > > > > > > > > HTH > > > > > > Azeez > > > > > > > > > > > > > > > > > > On Jan 19, 2008 12:50 AM, Sushil Dodake <[EMAIL PROTECTED]> > > > > > > wrote: > > > > > > > > > > > > > HI all i am using AXIS2 1.3 i am trying to enable logging in > > > > > > > to a log file .... > > > > > > > my probems are > > > > > > > 1. the log file is not created on machine even i set optins in > > > > > > > the LOG4j.properties > > > > > > > 2. Only INFO messeges are logged on console... DEBUG messges > > > > > > > dont appear. > > > > > > > i dont get what is the problem, my log4j.properties file looks > > > > > > > as below. > > > > > > > even if i put a fully qualified path name for the > > > > > > > log4j.appender.LOGFILE.File attribute as > > > > > > > log4j.appender.LOGFILE.File=C:\logs\axis2.log it didnt work > > > > > > > can sombody help me. > > > > > > > > > > > > > > # Set root category priority to INFO and its only appender to > > > > > > > CONSOLE. > > > > > > > > > > > > > > log4j.rootCategory=DEBUG, CONSOLE, LOGFILE > > > > > > > > > > > > > > #log4j.rootCategory=INFO, CONSOLE, LOGFILE > > > > > > > > > > > > > > # Set the enterprise logger priority to FATAL > > > > > > > > > > > > > > log4j.logger.org.apache.axis2.enterprise=FATAL > > > > > > > > > > > > > > log4j.logger.de.hunsicker.jalopy.io=FATAL > > > > > > > > > > > > > > log4j.logger.httpclient.wire.header=FATAL > > > > > > > > > > > > > > log4j.logger.org.apache.commons.httpclient=FATAL > > > > > > > > > > > > > > # CONSOLE is set to be a ConsoleAppender using a > > > > > > > PatternLayout. > > > > > > > > > > > > > > log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender > > > > > > > > > > > > > > log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout > > > > > > > > > > > > > > log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p %c - > > > > > > > %m%n > > > > > > > > > > > > > > # LOGFILE is set to be a File appender using a PatternLayout. > > > > > > > > > > > > > > log4j.appender.LOGFILE=org.apache.log4j.FileAppender > > > > > > > > > > > > > > log4j.appender.LOGFILE.File=axis2.log > > > > > > > > > > > > > > log4j.appender.LOGFILE.Append=true > > > > > > > > > > > > > > log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout > > > > > > > > > > > > > > log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p > > > > > > > %c %x - %m%n > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Thanks > > > > > > Afkham Azeez > > > > > > > > > > > > http://www.wso2.org > > > > > > GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E > > > > > > 0760 > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Thanks > > > > Afkham Azeez > > > > > > > > http://www.wso2.org > > > > GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760 > > > > > > > > > > > > > > > > -- > > Thanks > > Afkham Azeez > > > > http://www.wso2.org > > GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760 > > > > -- Thanks Afkham Azeez http://www.wso2.org GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760
