pessoal, existe uma forma do log4j pegar o nome do contexto da aplicação para gerar o nome do arquivo [sistema].log ?
algo como:
log4j.appender.FILE =org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=[b]{CONTEXTO}[/b].log
log4j.appender.FILE.MaxFileSize=1024KB
log4j.appender.FILE.MaxBackupIndex=10
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%-2d{dd/MM/yyyy HH:mm:ss} [%t] %5p %c:%L - %m%n
O nome do contexto eu não sei, mas segundo isto aqui:
http://logging.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html
você pode usar ${variavel} para obter acesso a uma System.getProperty (“variavel”) ou a uma variável definida nesse arquivo .properties (não sei exatamente como)
All option values admit variable substitution. The syntax of variable substitution is similar to that of Unix shells. The string between an opening “${” and closing “}” is interpreted as a key. The value of the substituted variable can be defined as a system property or in the configuration file itself. The value of the key is first searched in the system properties, and if not found there, it is then searched in the configuration file being parsed. The corresponding value replaces the ${variableName} sequence. For example, if java.home system property is set to /home/xyz, then every occurrence of the sequence ${java.home} will be interpreted as /home/xyz.
é eu vi, a gente até usa o ${catalina.home}/log/arquivo.log
mas eu queria pegar o contexto mesmo. Pois estamos padronizando todos os logs das aplicações. Mas eu vou ler um pouco o link.
valeu pela ajuda.