naamadheya
naamadheya

Reputation: 2482

Application logging at profile level in Websphere 8.5

Websphere 8.5 - I have a cluster set up on 2 nodes and two servers on each node, a total of 4 Server JVMs. An application is deployed on cluster, so basically runs on all 4 servers.

As per IBM WAS8.5, my application logs should come at all 4 server logs location as below,

    [WAS_HOME]\profiles\[PROFILE_1]\logs\[SERVER_1]\
    [WAS_HOME]\profiles\[PROFILE_1]\logs\[SERVER_2]\

    [WAS_HOME]\profiles\[PROFILE_2]\logs\[SERVER_3]\
    [WAS_HOME]\profiles\[PROFILE_2]\logs\[SERVER_4]\

but it is being generated at profile level

    Server 1 and 2 write at [WAS_HOME]\profiles\[PROFILE_1]\
    Server 3 and 4 write at [WAS_HOME]\profiles\[PROFILE_2]\

I have only 2 sets of logs, instead of 4 set of logs. Is there any configuration so that application logs gets generated at server level? This would help me analyze which server is serving the outside requests.

EDIT: log4j.properties-

    log4j.logger.cdamdb=DEBUG, cdaFileLog
    log4j.additivity.cdamdb=false

    log4j.appender.cdaFileLog=org.apache.log4j.RollingFileAppender
    log4j.appender.cdaFileLog.File=<nopath>firm-cda.log
    log4j.appender.cdaFileLog.MaxFileSize=25MB
    log4j.appender.cdaFileLog.MaxBackupIndex=2

Upvotes: 3

Views: 1531

Answers (1)

Brett Kail
Brett Kail

Reputation: 33936

By specifying File as "firm-cda.log" without a directory, the log file will be created in the current working directory, which is by default PROFILE_HOME rather than the server logs directory. If you want the file to reliably appear alongside the other server logs, you'll need to specify a directory. Since log4j supports variables, you could use File=${my.log4j.dir}/firm-cda.log and then define a JVM "custom" (system) property named my.log4j.dir in the WAS configuration.

Upvotes: 1

Related Questions