3
votes

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
1
My guess is your application is writing logs in the current working directory which is the profile directory. If you want them in logs/<server name> you would need to resolve the server name and do that in your code I think.Alasdair
cluster-analysis (aka: clustering) is a data mining technique. You probably meant load-balancing.Has QUIT--Anony-Mousse
@Alasdair i am using log4j, so I have a log4j.properties, and no specific path for logfiles is given, so that the logs come at the default server log location. I have edited the post adding the sample configuration of log4j.naamadheya

1 Answers

1
votes

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.