The system variable property substitution worked great with the "FileNamePattern" param...thanks! Is that available for use with all config values? For example the email appender's params?
I looked at the watchdogs, but it's not clear to me exactly how they get used? Do I specify it within the config doc itself? Do I need to programmatically call it? If it's the later, how do I programmatically force Log4J to reload the xml config doc? Thanks, Jon -----Original Message----- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 13, 2005 9:19 PM To: Log4J Users List Subject: Re: log4j-1.3alpha-7 - config load/reload? and watchdog? At 12:16 PM 12/13/2005 -0800, you wrote: >I'm trying to upgrade to log4j-1.3alpha-7, but not seeing what I would >expect...which is hopefully user error. > >First, I thought I could replace my call to >DOMConfigurator.configureAndWatch(<LOG4J_CONFIG_FILE>, ><LOG4J_CONFIG_FILE_CHECK>); > >With: > >JoranConfigurator joran = new JoranConfigurator(); >joran.doConfigure(<LOG4J_CONFIG_FILE>, >LogManager.getLoggerRepository()); > This should work fine, but I haven't verified this lately. I know it used to work. >However, I don't see log events being sent to my appender. Inserting >the following: System.setProperty("log4j.configuration", ><LOG4J_CONFIG_FILE>); >Forces the events to the log file appender I've set up. > You may want to report a bug on this in Apache's Bugzilla. >Secondly, how do I force a reload of the config? > Look into the watchdogs. I haven't really used them, so I can't give much direction. Maybe Mark Womack can help since he was pretty heavily involved in their design? Otherwise, you can use something like LogWeb to have a manual updating process. You can even upload config files. Unfortunately, LogWeb doesn't build against Log4j-1.3 without a couple tweaks. I keep meaning to create a patch and send it to the developer of LogWeb. Makes it run with either Log4j-1.2.xx or Log4j-1.3. >Third and finally can I specify any other a %d conversion specifier in >the FileNamePattern param for the TimeBasedRollingPolicy? I have two >server that I'd like to share the same log4j config, but I'd like the >server log files to go to two different directories. Ideally I could >specify the following (where %s{server.name} is a jvm system property >that evaluates to "server1" for one server and "server2" from another >jvm): > Just use ${server.name}. That will work just fine. <param name="FileNamePattern" value="/var/tmp/${server.name}/server.%d{yyyy-MM-dd}.log.gz"/> ><appender name="LOGFILE" >class="org.apache.log4j.rolling.RollingFileAppender"> > <rollingPolicy >class="org.apache.log4j.rolling.TimeBasedRollingPolicy"> > <param name="FileNamePattern" >value="/var/tmp/%s{server.name}/server.%d{yyyy-MM-dd}.log.gz"/> > </rollingPolicy> > <layout class="org.apache.log4j.PatternLayout"> > <param name="ConversionPattern" value="%d{MMM-dd-yyyy h:mm:ss:SSS >a, z} [%-5p] (%l) - %m\n"/> > </layout> ></appender> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
