Re: Log4j configuration

2010-07-28 Thread mokader

Thanks Jake,

Is there any way to override the configuration or remove the existing
appenders.

would the  call to LogManager.shutdown()and then
DOMConfigurator.configure(initUrl) work. 

Thanks in advance,
Mohammed
 

Jacob Kjome wrote:
> 
> Log4j configuration is cumulative.  One call to configure() does not
> override 
> another.  Instead, the configurations are combined.  Each time you
> configure() 
> on a config file that defines an appender, a new one will be added rather
> than 
> blow away the old one.  Therefore you get duplicate logging as more than
> one 
> appender is active.
> 
> That said, it seems like this behavior was configurable?  Or maybe we
> merely 
> discussed it a while back since the default behavior is somewhat
> surprising to 
> users?  Maybe one of the other Log4j developers recalls this discussion
> and 
> can provide details?
> 
> 
> Jake
> 
> 
> On Wed, 28 Jul 2010 03:17:25 -0700 (PDT)
>   mokader  wrote:
>> 
>> Hi,
>> 
>> I am adding logging enhancement to my app. There is already a log4j
>> wrapper
>> is available in my app. But the existing is in jar and I can not modify.
>> The
>> problem is, now I have two log4j.xml file. one for my enhancement and
>> other
>> for existing one.
>> 
>> I first initialize existing log4j wrapper, it uses
>> DOMConfigurator.configure(initUrl) to configure. After this I call my new
>> APIs, I follow the same DOMConfigurator.configure(initUrl) to override
>> the
>> configuration.
>> 
>> The problem here is, I have custom appender, which I specified in
>> log4j.xml
>> of my enhancement, but the custom appender is called twice - once from
>> existing APIs and another from my APIs. 
>> 
>> I dont know how log4j is invoking my custom appeder, when existing APIs
>> are
>> initialized. I looked this from stack trace.
>> -- 
>> View this message in context: 
>>http://old.nabble.com/Log4j-configuration-tp29285028p29285028.html
>> Sent from the Log4j - Users mailing list archive at Nabble.com.
>> 
>> 
>> -
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>>For additional commands, e-mail: log4j-user-h...@logging.apache.org
>> 
>> 
> 
> 
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Log4j-configuration-tp29285028p29289033.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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



Log4j configuration

2010-07-28 Thread mokader

Hi,

I am adding logging enhancement to my app. There is already a log4j wrapper
is available in my app. But the existing is in jar and I can not modify. The
problem is, now I have two log4j.xml file. one for my enhancement and other
for existing one.

I first initialize existing log4j wrapper, it uses
DOMConfigurator.configure(initUrl) to configure. After this I call my new
APIs, I follow the same DOMConfigurator.configure(initUrl) to override the
configuration.

The problem here is, I have custom appender, which I specified in log4j.xml
of my enhancement, but the custom appender is called twice - once from
existing APIs and another from my APIs. 

I dont know how log4j is invoking my custom appeder, when existing APIs are
initialized. I looked this from stack trace.
-- 
View this message in context: 
http://old.nabble.com/Log4j-configuration-tp29285028p29285028.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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



Re: I am trying to add chainsaw support to the eXist XML Database

2010-05-20 Thread mokader

Hi Scott,

I am not familiar with maven, but still I tried to checkout source from
repositary and tried mvn install.

build is successfull for extras and component.
but the build failed for receivers.

Is there any other way to get the latest build, other than building it from
source myself.

Thanks,
Mohammed


Scott Deboy wrote:
> 
>> I just committed a change to Chainsaw svn trunk (rev 946685) which
>> provides
>> support for using the log4j.configuration system property on the command
>> line to configure Chainsaw if the application-wide preferences field is
>> not
>> set (or cleared out and Chainsaw is restarted).
>>
>> The configuration.url must provide a URL
>>
>> java -classpath (classpath here)
>> -Dlog4j.configuration=file:///c:/downloads/tools/log4j/config/log4j.xml
>> org.apache.log4j.chainsaw.LogUI
> 

-- 
View this message in context: 
http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28630204.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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



Re: I am trying to add chainsaw support to the eXist XML Database

2010-05-20 Thread mokader

Hi Scott,

Thanks for your quick reply.

My application is executable and will be distributed to users, my users also
view logs.
for example, if a user press "view log" button, I need to open chainsaw.

As you said, I can configure in application-wide preferences screen, only
after launching the chainsaw.
I want to launch it pre-configured, like using command-line parameters when
chainsaw main class is launched.

Is there a way to send configuration file path as the command-line
arguments?

Thanks,
Mohammed


Scott Deboy wrote:
> 
> you can specify the URL to the configuration file in the application-wide
> preferences screen - specifying the URL to your configuration will cause
> the
> configuration to be used each time Chainsaw is started.
> 

-- 
View this message in context: 
http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28622012.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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



Re: I am trying to add chainsaw support to the eXist XML Database

2010-05-20 Thread mokader

Hi Scott,

For my existing application, we are using log4j and we have log file
appender.
I want to use chainsaw as the log viewer and need to load the file
automatically.
How to configure chainsaw to open a file when chainsaw is started.

Thanks in advance,
Mohammed


Scott Deboy wrote:
> 
> Chainsaw does have a receiver that can parse regular text files
> (LogFilePatternReceiver, and VFSLogFilePatternReceiver, which supports
> jakarta-commons-vfs file systems).
> 

-- 
View this message in context: 
http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28620483.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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