You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Cheung, Quinn" <QC...@rheinmetall.ca> on 2007/03/09 15:53:01 UTC

Dynamically changing log levels using Chainsaw

Hi all,
We want to use Chainsaw as a logviewer to debug our system by inspecting log messages while trying different scenarios. We would like to be able to have a way to dynamically enable/disable specific loggers that are being used in the system as well as set specific logging levels for each logger.   I know this can be done through the XML files, but it's a large distributed system and we want to do it without having to change all the XML files and re-start the system (ie: we want to do it dynamically).  I figure all we need is to add a communication channel for chainsaw to send information to the loggers (via a socket), and then add a mechanism on the chainsaw GUI to set the log levels. Chainsaw would then send the commands to set the logging levels to the loggers.  Has anyone done anything like this yet?  Does anyone have any other ideas?

Thanks then.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Dynamically changing log levels using Chainsaw

Posted by gaspode <ga...@gmail.com>.
Hi,

If you're happy with LogWeb that's fine by me, I guess it's all a
matter of taste. I meant mature in the sense "easy to integrate in
your project".

I was disappointed by logweb for the 3 following reasons:

- I never could make it work. I tried the non-Maven non-Struts distro
and had to struggle 1h with poorly documented dependencies to finally
only have some of the pages working  (now Maven would probably have
saved me some time there).

- I then tried to contact Nathan Coast at the address mentioned on the
web site but my mails bounced back (this was 2 or 3 months ago, I just
re-tried 2 minutes ago, the address seems to be running now)

- the web site at codeczar does not mention any updates since 2004
(http://www.codeczar.com/products/logweb/changes-report.html), so I
assumed the project was dead (which might be wrong according to this
new version you mention)

Now, maybe Logweb is a very good piece of software and I should have
been more patient or maybe I took the wrong approach. I'm just saying
that in comparison, I could have the Log4J 1.3 servlet running and
integrated in my project in less than 15 min.

I don't mean to offence anybody, espacially not Nathan, I think it's
really nice having people contributing such tools.

Cheers all,

Gaspode

On 3/12/07, Jacob Kjome <ho...@visi.com> wrote:
> At 11:54 AM 3/12/2007, you wrote:
>  >Log4J 1.3 will actually provide a servlet (org.apache.log4j.servlet)
>  >that let you change the log level dynamically. This servlet is, I
>  >think, much more mature than logweb.
>  >
>
> What makes you think this?  I'm not saying anything negative about
> the servlet included in Log4j 1.3, but LogWeb it quite good.  And the
> author even announced that a new version was coming out.  I don't
> know what that entails, but if it improves upon what it already
> there, I think it will be quite nice.
>
>  >The good news is that is it compatible with the current 1.2.14 Log4J,
>  >so you just have to find the classes you need in Log4J 1.3, package
>  >them in some way and include them in your project.
>  >
>  >The even better news is that Fabrizio Giustina and his friends (see
>  >http://sourceforge.net/projects/openutils/ ) have already bundled all
>  >that for you into a nice package called openutils.
>  >
>  >If you're using maven, getting it inside your project is as simple as that:
>  >
>  > <dependency>
>  >  <groupId>net.sourceforge.openutils</groupId>
>  >  <artifactId>openutils-log4j</artifactId>
>  >  <version>1.0</version>
>  > </dependency>
>  >
>  >add then some mapping to you Web app:
>  >
>  > <servlet>
>  >   <servlet-name>log4j</servlet-name>
>  >
> <servlet-class>it.openutils.log4j.Log4jConfigurationServlet</servlet-class>
>  > </servlet>
>  >
>  >
>  > <servlet-mapping>
>  >  <servlet-name>log4j</servlet-name>
>  >  <url-pattern>/log4j/*</url-pattern>
>  > </servlet-mapping>
>  >
>  >And you're done :-)
>  >
>  >Have fun,
>  >
>  >Gaspode
>  >
>  >
>  >
>  >
>  >
>  >
>  >On 3/9/07, James Stauffer <st...@gmail.com> wrote:
>  >> Look ingo LogWeb.  It is a servlet that allows changing the config.
>  >>
>  >> On 3/9/07, Cheung, Quinn <QC...@rheinmetall.ca> wrote:
>  >> > Hi all,
>  >> > We want to use Chainsaw as a logviewer to debug our system by
>  >inspecting log messages while trying different scenarios. We would
>  >like to be able to have a way to dynamically enable/disable specific
>  >loggers that are being used in the system as well as set specific
>  >logging levels for each logger.   I know this can be done through the
>  >XML files, but it's a large distributed system and we want to do it
>  >without having to change all the XML files and re-start the system
>  >(ie: we want to do it dynamically).  I figure all we need is to add a
>  >communication channel for chainsaw to send information to the loggers
>  >(via a socket), and then add a mechanism on the chainsaw GUI to set
>  >the log levels. Chainsaw would then send the commands to set the
>  >logging levels to the loggers.  Has anyone done anything like this
>  >yet?  Does anyone have any other ideas?
>  >> >
>  >> > Thanks then.
>  >> >
>  >> >
>  >> >
>  >> > ---------------------------------------------------------------------
>  >> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>  >> > For additional commands, e-mail: log4j-user-help@logging.apache.org
>  >> >
>  >> >
>  >>
>  >>
>  >> --
>  >> James Stauffer        http://www.geocities.com/stauffer_james/
>  >> Are you good? Take the test at http://www.livingwaters.com/good/
>  >>
>  >> ---------------------------------------------------------------------
>  >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>  >> For additional commands, e-mail: log4j-user-help@logging.apache.org
>  >>
>  >>
>  >
>  >---------------------------------------------------------------------
>  >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>  >For additional commands, e-mail: log4j-user-help@logging.apache.org
>  >
>  >
>  >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Dynamically changing log levels using Chainsaw

Posted by Jacob Kjome <ho...@visi.com>.
At 11:54 AM 3/12/2007, you wrote:
 >Log4J 1.3 will actually provide a servlet (org.apache.log4j.servlet)
 >that let you change the log level dynamically. This servlet is, I
 >think, much more mature than logweb.
 >

What makes you think this?  I'm not saying anything negative about 
the servlet included in Log4j 1.3, but LogWeb it quite good.  And the 
author even announced that a new version was coming out.  I don't 
know what that entails, but if it improves upon what it already 
there, I think it will be quite nice.

 >The good news is that is it compatible with the current 1.2.14 Log4J,
 >so you just have to find the classes you need in Log4J 1.3, package
 >them in some way and include them in your project.
 >
 >The even better news is that Fabrizio Giustina and his friends (see
 >http://sourceforge.net/projects/openutils/ ) have already bundled all
 >that for you into a nice package called openutils.
 >
 >If you're using maven, getting it inside your project is as simple as that:
 >
 > <dependency>
 >  <groupId>net.sourceforge.openutils</groupId>
 >  <artifactId>openutils-log4j</artifactId>
 >  <version>1.0</version>
 > </dependency>
 >
 >add then some mapping to you Web app:
 >
 > <servlet>
 >   <servlet-name>log4j</servlet-name>
 > 
<servlet-class>it.openutils.log4j.Log4jConfigurationServlet</servlet-class>
 > </servlet>
 >
 >
 > <servlet-mapping>
 >  <servlet-name>log4j</servlet-name>
 >  <url-pattern>/log4j/*</url-pattern>
 > </servlet-mapping>
 >
 >And you're done :-)
 >
 >Have fun,
 >
 >Gaspode
 >
 >
 >
 >
 >
 >
 >On 3/9/07, James Stauffer <st...@gmail.com> wrote:
 >> Look ingo LogWeb.  It is a servlet that allows changing the config.
 >>
 >> On 3/9/07, Cheung, Quinn <QC...@rheinmetall.ca> wrote:
 >> > Hi all,
 >> > We want to use Chainsaw as a logviewer to debug our system by
 >inspecting log messages while trying different scenarios. We would
 >like to be able to have a way to dynamically enable/disable specific
 >loggers that are being used in the system as well as set specific
 >logging levels for each logger.   I know this can be done through the
 >XML files, but it's a large distributed system and we want to do it
 >without having to change all the XML files and re-start the system
 >(ie: we want to do it dynamically).  I figure all we need is to add a
 >communication channel for chainsaw to send information to the loggers
 >(via a socket), and then add a mechanism on the chainsaw GUI to set
 >the log levels. Chainsaw would then send the commands to set the
 >logging levels to the loggers.  Has anyone done anything like this
 >yet?  Does anyone have any other ideas?
 >> >
 >> > Thanks then.
 >> >
 >> >
 >> >
 >> > ---------------------------------------------------------------------
 >> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
 >> > For additional commands, e-mail: log4j-user-help@logging.apache.org
 >> >
 >> >
 >>
 >>
 >> --
 >> James Stauffer        http://www.geocities.com/stauffer_james/
 >> Are you good? Take the test at http://www.livingwaters.com/good/
 >>
 >> ---------------------------------------------------------------------
 >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
 >> For additional commands, e-mail: log4j-user-help@logging.apache.org
 >>
 >>
 >
 >---------------------------------------------------------------------
 >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
 >For additional commands, e-mail: log4j-user-help@logging.apache.org
 >
 >
 > 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Dynamically changing log levels using Chainsaw

Posted by gaspode <ga...@gmail.com>.
Log4J 1.3 will actually provide a servlet (org.apache.log4j.servlet)
that let you change the log level dynamically. This servlet is, I
think, much more mature than logweb.

The good news is that is it compatible with the current 1.2.14 Log4J,
so you just have to find the classes you need in Log4J 1.3, package
them in some way and include them in your project.

The even better news is that Fabrizio Giustina and his friends (see
http://sourceforge.net/projects/openutils/ ) have already bundled all
that for you into a nice package called openutils.

If you're using maven, getting it inside your project is as simple as that:

 <dependency>
  <groupId>net.sourceforge.openutils</groupId>
  <artifactId>openutils-log4j</artifactId>
  <version>1.0</version>
 </dependency>

add then some mapping to you Web app:

 <servlet>
   <servlet-name>log4j</servlet-name>
   <servlet-class>it.openutils.log4j.Log4jConfigurationServlet</servlet-class>
 </servlet>


 <servlet-mapping>
  <servlet-name>log4j</servlet-name>
  <url-pattern>/log4j/*</url-pattern>
 </servlet-mapping>

And you're done :-)

Have fun,

Gaspode






On 3/9/07, James Stauffer <st...@gmail.com> wrote:
> Look ingo LogWeb.  It is a servlet that allows changing the config.
>
> On 3/9/07, Cheung, Quinn <QC...@rheinmetall.ca> wrote:
> > Hi all,
> > We want to use Chainsaw as a logviewer to debug our system by inspecting log messages while trying different scenarios. We would like to be able to have a way to dynamically enable/disable specific loggers that are being used in the system as well as set specific logging levels for each logger.   I know this can be done through the XML files, but it's a large distributed system and we want to do it without having to change all the XML files and re-start the system (ie: we want to do it dynamically).  I figure all we need is to add a communication channel for chainsaw to send information to the loggers (via a socket), and then add a mechanism on the chainsaw GUI to set the log levels. Chainsaw would then send the commands to set the logging levels to the loggers.  Has anyone done anything like this yet?  Does anyone have any other ideas?
> >
> > Thanks then.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>
> --
> James Stauffer        http://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Dynamically changing log levels using Chainsaw

Posted by James Stauffer <st...@gmail.com>.
Look ingo LogWeb.  It is a servlet that allows changing the config.

On 3/9/07, Cheung, Quinn <QC...@rheinmetall.ca> wrote:
> Hi all,
> We want to use Chainsaw as a logviewer to debug our system by inspecting log messages while trying different scenarios. We would like to be able to have a way to dynamically enable/disable specific loggers that are being used in the system as well as set specific logging levels for each logger.   I know this can be done through the XML files, but it's a large distributed system and we want to do it without having to change all the XML files and re-start the system (ie: we want to do it dynamically).  I figure all we need is to add a communication channel for chainsaw to send information to the loggers (via a socket), and then add a mechanism on the chainsaw GUI to set the log levels. Chainsaw would then send the commands to set the logging levels to the loggers.  Has anyone done anything like this yet?  Does anyone have any other ideas?
>
> Thanks then.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org