|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Logging with Log4J in Java ComputeNode |
« View previous topic :: View next topic » |
Author |
Message
|
tariqjawed83 |
Posted: Fri Dec 25, 2009 12:18 pm Post subject: Logging with Log4J in Java ComputeNode |
|
|
Newbie
Joined: 24 Nov 2009 Posts: 6
|
First I was logging some log statements using MbService.logInformation() but the WMB Administrator said, you should not log the application logs into syslog.
so I switch towards Log4J in my Java ComputeNode, but I'm concerned about the performance, just wondering what would be the impact on regular flows.
currently I'm using one Java Class static initializer, to initialize the Log4J configurations, and saving the reference of the Logger in the static variable of that class.
and from all Java Compute Nodes, I'm calling the same method,
Utils.logger.info("Logging Message!");
Is it the right approach? I dont want to create so many log files, one for each flow on daily basis.
but it looks like for each flow we might initialize the log4j everytime??? and there will also be file locking problems.
any suggestions on that??? |
|
Back to top |
|
 |
deepeshk79 |
Posted: Fri Dec 25, 2009 12:30 pm Post subject: |
|
|
Apprentice
Joined: 25 Mar 2007 Posts: 45 Location: Los Angeles
|
why dont you move this logger initializer in a different flow (called as as a LogIntiailizer) and deploy it in your execution group?
In this way you can keep the application flows free from initializing for every message or thread. |
|
Back to top |
|
 |
tariqjawed83 |
Posted: Fri Dec 25, 2009 12:43 pm Post subject: More Elaboration |
|
|
Newbie
Joined: 24 Nov 2009 Posts: 6
|
Thanks for your quick reply, can you please elaborate little more.
I'm new to Broker, how will that flow LogIntiailizer (as you said), will be Initialized, I know static Initializer will be loaded when the class loads.
If nobody calls that flow explicitly, will it be initialized by itself? |
|
Back to top |
|
 |
deepeshk79 |
Posted: Fri Dec 25, 2009 12:49 pm Post subject: |
|
|
Apprentice
Joined: 25 Mar 2007 Posts: 45 Location: Los Angeles
|
After you deploy, you should send a test message to that flow only once. Once this is done, you are ready to go.... |
|
Back to top |
|
 |
tariqjawed83 |
Posted: Fri Dec 25, 2009 1:17 pm Post subject: AsyncAppender Appender |
|
|
Newbie
Joined: 24 Nov 2009 Posts: 6
|
Good Thanks,
will AsyncAppender for Log4j will work fine with broker environment, because since I will be writing to one file, just thinking to use AsyncAppender... |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|