jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <n...@apache.org>
Subject Re: Injecting own Logger documenation?
Date Mon, 16 Feb 2015 16:52:22 GMT
Hi Forrest,

To create a custom logger you just have to extend the jclouds BaseLogger
and create a LoggerFactory that creates instances of your logger. If you
have a look at the existing Log4jLogger [1], you'll see how you can
implement both. Once you have the logger and the factory, you just need to
create a Guice module that binds your custom implementation to the jclouds
Logger interface. Again, have a look at the existing Log4JLoggingModule [2]
to see how you can do this.

Once you have the logger implementation, the factory, and the Guice module,
you just need to create the jclouds Context passing your logging module:

   .modules(ImmutableSet.of(new YourCustomLoggingModule()))




On 16 February 2015 at 17:31, Forrest Townsend <forrest.town18@gmail.com>

> Hello,
> Is there documentation that currently exists showing how to inject a
> custom logger in jclouds? My goal is to use a logger that only prints out
> errors to a file when I don't enable tracing through my program. But if I
> do enable tracing, it would lower the level of tracing for debug.
> Thanks.

View raw message