cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Pötz <>
Subject Re: [c3-monitoring] Logging reconfiguration.
Date Tue, 05 May 2009 19:35:56 GMT
Dariusz Łuksza wrote:
> 2009/4/25 Dariusz Łuksza <
> <>>:
>> I'm not quite sure what should I do witch "old"
>> cocoon-configuration-api and cocoon-spring-configurator. Should I :
>>  [1] add dependency to cocoon-monitoring on cocoon-configuration-api
>> or cocoon-spring-configurator,
>>  [2] create another solution based on cocoon-spring-configurator
>>  [3] integrate both project and add it to c3
>> ?
> For now I've decided that I'll user directly LogRepository log4j to
> achieve reconfiguration of logging level for single class or package.
> First milestone in logging reconfiguration via JMX would be adding
> possibility of (permanent or temporal) change log level for single
> package or class.
> To achieve that I implemented two class (Log4JReconfigure and
> RestoreLoggingConfiguration) and added cocoon-monitoring.xml for
> spring-jmx configuration.
> So first class (Log4JReconfigure) is an MBean that would be exposed on
> JXM service. It has 3 public methods :
> * getLoggers - returns all configured loggers with their logging level
> * setLoggingLevel - this method set logging level for permanent (if
> logger already exist it will only change logging level in other case it
> will create logger with that level)
> * setLoggingTempoporalLevel - change logging level or single class or
> package only some time and then log level is set back to old value
> Second class (RestoreLoggingConfiguration) is used only
> in setLoggingTempoporalLevel method and it performs restore old config
> after specified time (it use Timer class inside ;))
> Full sources of this classes are in attachment, for proper work you will
> need new-cocoon-monitoring-module2.patch from  COCOON3-33 jira issue.

I've tried to apply your patch but it's a git patch and not a unified diff.

> btw. Is there any possibility to write junit test for that functionalities ?

good question. Maybe we can provide some integration tests but this
seems to be difficult too.

> In future this code could be moved to cocoon-spring-configurator project.
> It is only my proposition how this fictionally could be implemented.
> WDYT ?

More feedback as soon as I can apply your patch.

Reinhard Pötz                           Managing Director, {Indoqa} GmbH

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member        

View raw message