I have created a sample application with log4cxx and it works great.

        Requirement in our application was to create a wrapper around log4cxx
functionality, so that in future any other logging functionality can be used
instead of log4cxx. 

        For that, we created a component, wrapping log4cxx functionality using
software component architecture (sca) framework.

a.      This wrapper component is loaded by other components or other
applications
b.      Component method, initialize() is called with the filename argument (xml
properties filename )
c.      Component passes the argument to DOM configurator. 

Issue:
            File name passed from component to DOM configurator never gets
passed and following is the error inside log4cxx. 
“log4cxx: Could not open file [ ] “

We could observe this by setting “LogLog::setInternalDebugging( true );”
(in sample application, file name is printed instead of [] and works fine)

Which means parameter we are passing from our wrapper component to logging
framework is failing. We have tried by passing wstring, string,  passing
hard coded value, declaring a string variable and passing that variable….but
the result is the same, does’t work. We have even tried Configuring using
other overloaded “configureAndWatch” functions.
a.     Void ConfigureAndWatch(filename)
                    Static Methods
b.     Void configureAnd Watch(filename, delay)                
c.      Void doConfigure(filename, hierarchy)        ---------- Public
method

    We were successful in logging with 
 BasicConfigurator::configure() method only (but this does not accept any
configuration filename as argument)

Any help in fixing the issue is greatly appreciated. 




--
View this message in context: 
http://apache-logging.6191.n7.nabble.com/using-log4cxx-from-sca-component-tp44065.html
Sent from the Log4cxx - Dev mailing list archive at Nabble.com.

Reply via email to