ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Logging with Log4J in Java ComputeNode

Post new topic  Reply to topic
 Logging with Log4J in Java ComputeNode « View previous topic :: View next topic » 
Author Message
tariqjawed83
PostPosted: Fri Dec 25, 2009 12:18 pm    Post subject: Logging with Log4J in Java ComputeNode Reply with quote

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
View user's profile Send private message Send e-mail
deepeshk79
PostPosted: Fri Dec 25, 2009 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
tariqjawed83
PostPosted: Fri Dec 25, 2009 12:43 pm    Post subject: More Elaboration Reply with quote

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
View user's profile Send private message Send e-mail
deepeshk79
PostPosted: Fri Dec 25, 2009 12:49 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
tariqjawed83
PostPosted: Fri Dec 25, 2009 1:17 pm    Post subject: AsyncAppender Appender Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Logging with Log4J in Java ComputeNode
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.