Configuring directory path for fileappender in log4j.properties

I want to write log data to a file where the directory path of the file should be picked from a unix environmental variable. How can you configure this in log4j.properties?

*******************************************************

log4j.rootLogger=INFO, A

# A is set to be a FileAppender.

log4j.appender.A=org.apache.log4j.FileAppender

# A uses PatternLayout.

log4j.appender.A.File=$UNIX_ENV_VARIABLE/A.log <= This is what I want. The dir path should be picked from some env path

log4j.appender.A.layout=org.apache.log4j.PatternLayout

log4j.appender.A.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n

*******************************************************

Or if this should be done in code, then please guide me on that.

Thanks in advance

[829 byte] By [mk47a] at [2007-10-3 8:41:28]
# 1

Hi,

i am facing one problem,

where today's log and yesterday log has log statements for today with same date.. but different data. any one pls help.

this is the properties i configured

# Logger for A messages

log4j.logger.A=debug, A_R1

log4j.appender.A_R1=org.apache.log4j.DailyRollingFileAppender

log4j.appender.A_R1.File=/var/opt/wmeaidata/app_data/log4j/logs/eai_a.log

log4j.appender.A_R1.MaxFileSize = 5MB

log4j.appender.A_R1.MaxBackupIndex = 3

log4j.appender.A_R1.layout=org.apache.log4j.PatternLayout

log4j.appender.A_R1.layout.ConversionPattern=%d{MMM dd, yyyy hh:mm:ss a}|%c-%X{host}|%m%n

Thanks

venkat

venkata_wma at 2007-7-15 3:49:47 > top of Java-index,Archived Forums,Debugging Tools and Techniques...