> -----Original Message-----
> From: David Leangen [mailto:[EMAIL PROTECTED]
> Sent: Sunday, July 25, 2004 16:51
> To: [EMAIL PROTECTED]
> Subject: RE: Logging configuration
> Importance: High
> 
> 
> Ok, thanks, Steve! That works nicely. :-)
> 
> Not quite sure I understand the "categories" mechanism, though... Is
there
> a page somewhere that explains this?

Don't worry about the categories inside the logging configuration itself
- these are only used to setup logging channels that inside the logging
system (and only needed for hard-core sub-system debugging).

Normal application level categories can be declared in a deployment
configuration (under <targets><target>) which is explained here:

http://avalon.apache.org/products/runtime/reference/kernel/overrides/tar
get/categories/index.html

> 
> Also, is it possible to output "info" and above to the console, and
> "debug" and above to a file?

No - not for a single category. But you could use separate logging
categories. For example:

  Public MyWidget( Logger logger )
  {
      m_debugChannel = logger.getChildLogger( "debug" );
      m_infoChannel = logger.getChildLogger( "info" );
  }

This would create two child channels which you could configure top have
different targets and different logging priorities.

> If so, how?

In the runtime/logging/logkit/test project you will find a test case
that does something similar to the above.  It logs to both file and
console as part of the unit test execution.  You may get some ideas by
looking at the sources.  The source is:

src\test\org\apache\avalon\logging\logkit\test\
DefaultLoggingManagerTestCase.java

The configuration is in test\etc\test\logkit\logging.xml

Cheers, Steve.

> Thanks!
> 
> 
> 
> > -----Original Message-----
> > From: Stephen McConnell [mailto:[EMAIL PROTECTED]
> > Sent: July 25, 2004 23:14
> > To: 'Avalon framework users'; [EMAIL PROTECTED]
> > Subject: RE: Logging configuration
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: David Leangen [mailto:[EMAIL PROTECTED]
> > > Sent: Sunday, July 25, 2004 15:56
> > > To: [EMAIL PROTECTED]
> > > Subject: Logging configuration
> > > Importance: High
> > >
> > >
> > > I'd like to configure my components to log to a file.
> > >
> > > I read this page:
> > >
> >
http://avalon.apache.org/products/runtime/system/logging/api/index.html
> > >
> > >
> > > But it doesn't say WHERE or HOW to do this. Doesn't say either
what
> > the
> > > attributes should be.
> > >
> > > I tried using this tag in a few places:
> > >    @avalon.logging.configuration name="someUrl"
> > >
> > > But that didn't do the trick.
> > >
> > >
> > > Any suggestions?
> >
> > Merlin looks for the property merlin.logging.config to determine the
> > location of the logging configuration.  If you use the -info flag
when
> > starting merlin you will see the following line:
> >
> >   ${merlin.logging.config} == null
> >
> > You can change this value by adding the merlin.logging.config
property
> > in a property file named merlin.properties.
> >
> > E.g. in ${merlin.home}/merlin.properties.
> >
> > The value to assign should be a url pointing to a logging
configuration.
> > For example:
> >
> > merlin.logging.config = file:///${merlin.dir}/logging.xml
> >
> > The contents of the logging.xml file should be something along the
lines
> > of the configuration file show in this example:
> >
> >
http://avalon.apache.org/products/runtime/system/logging/logkit/examples
> > /logkit.html
> >
> > Hope that helps.
> >
> > Cheers, Steve.
> >
> >
> > >
> > > Thanks!
> > >
> > >
> > >
> > >
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to