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 » Reloading log4j.properties file?

Post new topic  Reply to topic
 Reloading log4j.properties file? « View previous topic :: View next topic » 
Author Message
TonyD
PostPosted: Mon Nov 17, 2008 3:18 pm    Post subject: Reloading log4j.properties file? Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Has anyone implemented an approach for reloading the log4j.properties file that avoids the need to restart the message broker?
Back to top
View user's profile Send private message Send e-mail
marcin.kasinski
PostPosted: Tue Nov 18, 2008 4:52 am    Post subject: Re: Reloading log4j.properties file? Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

TonyD wrote:
Has anyone implemented an approach for reloading the log4j.properties file that avoids the need to restart the message broker?


Do you have to use log4j.properties file ?
Log4J lets you set propertis manually in your code:

Code:
log = Logger.getLogger(file);
      
log.setAdditivity(false);
      

String logPattern="%-5p:%d{ISO8601}:%t:%m%n";
            
PatternLayout layout = new PatternLayout(logPattern);
      
String datePattern = "yyyy-MM-dd";


DailyRollingFileAppender appender=null;

   appender =
      new DailyRollingFileAppender(
         layout,
         file,
         datePattern);



Why dont you use here UDP to set log4J properties ?


Then you could use TimerNode to change it without restarting broker.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
hopsala
PostPosted: Tue Nov 18, 2008 6:09 am    Post subject: Re: Reloading log4j.properties file? Reply with quote

Guardian

Joined: 24 Sep 2004
Posts: 960

marcin.kasinski wrote:
Why dont you use here UDP to set log4J properties ?

Then you could use TimerNode to change it without restarting broker.

??

UDP variables can only be given a value once, at design time or bar deploy time. From the lit:
Quote:
A user-defined property (UDP) is a user-defined constant whose initial value can be modified, at design time, by the Message Flow editor, or overridden, at deployment time, by the Broker Archive editor.


AFAIK, the only way to do what you want is to use a database, with a singleton pattern used to refresh.
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Tue Nov 18, 2008 6:25 am    Post subject: Re: Reloading log4j.properties file? Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

hopsala wrote:
marcin.kasinski wrote:
Why dont you use here UDP to set log4J properties ?

Then you could use TimerNode to change it without restarting broker.

??

UDP variables can only be given a value once, at design time or bar deploy time. From the lit:
Quote:
A user-defined property (UDP) is a user-defined constant whose initial value can be modified, at design time, by the Message Flow editor, or overridden, at deployment time, by the Broker Archive editor.


AFAIK, the only way to do what you want is to use a database, with a singleton pattern used to refresh.



It was just shortcut

My proposal was:

Use UDP (connection data) to read new parameters (from DB, LDAP, …)

Then use these red data in your log4J code.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
JLRowe
PostPosted: Tue Nov 18, 2008 7:06 am    Post subject: Re: Reloading log4j.properties file? Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

TonyD wrote:
Has anyone implemented an approach for reloading the log4j.properties file that avoids the need to restart the message broker?


I assume your code is calling log4j through a custom node or ESQL procedure. I think there is a java system property you can set for log4j, that tells it to kick off a thread to refresh the logging.

http://marc.info/?l=log4j-user&m=118778942431123&w=2

Otherwise, your only option is to write code to kick that thread off yourself, or do as we do and write a logging facade in java that refreshes the logging at set intervals.
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 » Reloading log4j.properties file?
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.