How to completely disable logging?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to completely disable logging?

Sergio Basurco
Hi all,

I'm using a 3d party library (namely LIB) which uses log4cxx. I get an
error when closing my application, that log4cxx appender was not found
for some module.

I want to disable logging completely. From what I've found I can set a
log4cxx.properties file. How can I completely disable logging using this
file?

Best regards,

--
Sergio Basurco,
Coherent Synchro



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to completely disable logging?

Sergio Basurco
Guten tag Thorsten,

Here's the complete error, dumped when closing the whole application:

log4cxx: No appender could be found for logger (LIB.LibClass).
log4cxx: Please initialize the log4cxx system properly.

Let me give you some background on how I'm using this library.

  - LIB is a managed .NET dll
  - My application is an unmanaged (native) c++ program.
  - I use a c++/cli wrapper to access LIB (LIBWrapper)

Using LIB in a managed environment does not output the error. It's only
when I use it through my wrapper that this happens. My best guess is
that log4cxx is looking for initialization properties and not finding it.

Best!



El 19-Feb-15 a las 2:50 PM, Thorsten Schöning escribió:

> Guten Tag Sergio Basurco,
> am Donnerstag, 19. Februar 2015 um 12:47 schrieben Sie:
>
>> I'm using a 3d party library (namely LIB) which uses log4cxx. I get an
>> error when closing my application, that log4cxx appender was not found
>> for some module.
>
> Really appender and not logger? Are you able to post the complete
> error here? The latter sounds like your LIB is pre-configuring
> log4cxx, in which case you may or may not are able override it.
>
>> I want to disable logging completely. From what I've found I can set a
>> log4cxx.properties file. How can I completely disable logging using this
>> file?
>
> That depends on your LIB and how it configures log4cxx. By default
> logging can easily be deactivated by settings the log level for all
> loggers to NONE.
>
> http://logging.apache.org/log4cxx/usage.html
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>

--
Sergio Basurco,
Coherent Synchro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to completely disable logging?

Sergio Basurco
Hi,

Thanks!

Is there a way to undefine LOG4CXX_CONFIGURATION override logger options externally?

If I place a log4cxx.properties file next to my executable, I get all sorts of errors from log4cxx. So I assumed it was possible to override initial options, or at least disable logging for my application's scope.



El 19-Feb-15 a las 4:16 PM, Thorsten Schöning escribió:
Guten Tag Sergio Basurco,
am Donnerstag, 19. Februar 2015 um 15:29 schrieben Sie:

Using LIB in a managed environment does not output the error. It's only
when I use it through my wrapper that this happens. My best guess is 
that log4cxx is looking for initialization properties and not finding it.
Read the following paragraph, that's what Log4cxx is doing
automatically. Everything else is up to the LIB and you need to ask
it's maintainer.

Default Initialization Procedure
http://logging.apache.org/log4cxx/usage.html

Mit freundlichen Grüßen,

Thorsten Schöning


-- 
Sergio Basurco,
Coherent Synchro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to completely disable logging?

Sergio Basurco
Hello Thor,

Sorry I took long to reply. I will just inform the library authors and
dismiss the logging messages on exit. Thank you very much for your help!

Regards,

El 19-Feb-15 a las 6:48 PM, Thorsten Schöning escribió:

> Guten Tag Sergio Basurco,
> am Donnerstag, 19. Februar 2015 um 17:44 schrieben Sie:
>
>> Is there a way to undefine LOG4CXX_CONFIGURATIONoverride logger options         externally?
> If you don't define it yourself it's not used, if it used and not
> defined by you it's defined by the LIB for any reason and you can't
> override it.
>
>> If I place a log4cxx.properties file next to my executable, I
>> get all sorts of errors from log4cxx.
> But which? Your configuration file may simply be wrong or you may miss
> some appenders in your config. Though if you just strip down to a root
> logger and maybe a console appender and provide the root logger with
> level NONE, there shouldn't be any logs anymore. Everything else
> depends on the errors and what your LIB is doing. It may have some
> config hard coded or such...
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>

--
Sergio Basurco,
Coherent Synchro

Loading...