Repository selectors, useful?

2008-11-26 Thread Ceki Gulcu


Hello,

I am in the process of fixing bugs related to context selectors in logback.
Context selectors are the equivalent of repository selectors in log4j. However,
while few years back I thought that context selectors, aka repository selectors,
were the wave of the future, I am increasingly skeptical about their usefulness.

If you are using context/repository selectors, could you please explain why?

--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch

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



AW: [SPAM (Bayesain Analysis)] - Repository selectors, useful? - Bayesian Filter detected spam

2008-11-26 Thread Bender Heri
Hallo Ceki

I found log4j's RepositorySelector very useful, I think I would not have been 
able to solved my problem without it.

I use it in a System which is designed to maintain different customers. A 
single customer should never see any data (or even know about the existence) of 
other customers. So I needed to separate also all logs. One core application is 
a scheduler app which maintains different jobs which run at regular intervals 
(configured for each customer and job kind). The jobs make heavy use of common 
libraries (in fact most of the work is done within these libraries, which make 
a lot of log outputs). This log outputs should never mix between customers and 
jobs.

Such a job is running in its own thread. Therefore I can use the MDC which is 
feeded at every thread start with infos about the current job and the current 
customer. This info is then used by the repository selector for choosing the 
correct repository (where file appenders are defined with filenames and storage 
locations mirroring these MDC infos). 

Maybe your new logback has other useful constructs to solve such a problem. 
Using Log4j's RepositorySelector was a bit hard to understand at the beginning, 
specially the need for having special logging code (MDC, configuring the file 
appenders) at every thread start (was a bit complex in combination with a 
thread pooling). I wished that such things could be done only by configuration. 
More problems: Logger instances in library classes cannot be instantiated 
statically, and utility classes with static methods and other singletons must 
fetch the logger on each method entry (I had to disable log outputs from third 
party libraries which do not obey such circumstances).

Greetings 
Heri Bender



-Ursprüngliche Nachricht-
Von: Ceki Gulcu [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 26. Dezember 2008 14:06
An: Log4J Users List
Betreff: [SPAM (Bayesain Analysis)] - Repository selectors, useful? - Bayesian 
Filter detected spam


Hello,

I am in the process of fixing bugs related to context selectors in logback.
Context selectors are the equivalent of repository selectors in log4j. However, 
while few years back I thought that context selectors, aka repository 
selectors, were the wave of the future, I am increasingly skeptical about their 
usefulness.

If you are using context/repository selectors, could you please explain why?

--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch

-
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]



calling logger from one location (method)

2008-11-26 Thread Andy Rozman
Hi !

I have one weird request... I would like to call log from one certain
method. Problem is that I need logging output to be sent to my gui as
well as into log file (some logs not all), so I wanted to create method
that would call logger... something like this:

public void writeLog(int type, String msg)
{
 // some my code

 if (type==DEBUG)
 {
  log.debug(msg);
 }
 // some more code and if conditions

}


Problem is that whenevr I write to log through this method I get as
source this method. Would it be possible to make so, that logger writes
as source originating method.

Thank you for all answers...
Andy

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



log4j ignoring log4j.properties and only showing INFO messages

2008-11-26 Thread Farrukh Najmi

I have been using log4j 1.2.14 and commons-logging 1.1 in my project
successfully for a long time.
All of a sudden I am finding that my log4j.properties file can no longer
control logging behavior
for log4j. The only messages that are logged are INFO messages.

Since my project is a maven project with many direct and indirect
dependencies its possible that one of those dependencies changed in some way
to change my apps logging behavior.

I have tried specifying my log4j file explicitly using system property:

-Dlog4j.configuration=file:///somedir/log4j.properties

No joy with that. Expected trace messages till did not appear.

Then I wondered perhaps the problem is in commons-logging so I tried to turn
diagnostic on in common-logging using system property:

 -Dorg.apache.commons.logging.diagnostics.dest=somefile.txt

Still no joy. No file was created.

What could be wrong and how can I debug this further?

Thanks for your help.
-- 
View this message in context: 
http://www.nabble.com/log4j-ignoring-log4j.properties-and-only-showing-INFO-messages-tp20709671p20709671.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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



initialize the log4j system properly

2008-11-26 Thread Dipocse

Hi All
I've a database (PRJ) and I'm trying to connect from Asterisk server to that
database. In the shell script i used a log4j-1.2.11.jar with all others jar
files. 

The shell script for runagi.sh is :

#!/bin/sh 

JARS="curtin.jar:/lib/log4j-1.2.11.jar:/lib/jta.jar:/lib/antlr-2.7.6rc1.jar:/lib/ehcache-1.1.jar:/lib/cglib-2.1.3.jar:/lib/dom4j-1.6.1.jar:/lib/mail.jar:/lib/commons-lang-1.0.1.jar:/lib/mysql-connector-java-3.1.10-bin.jar:/lib/asm-attrs.jar:/lib/commons-logging-1.0.4.jar:/lib/commons-collections-2.1.1.jar:/lib/mailet_1_0.jar:/lib/asterisk-java-0.2.jar:/lib/jdom.jar:/lib/rome-0.7.jar:/lib/asm.jar:/lib/hibernate3.jar:/lib/activation.jar:/lib/c3p0-0.9.0.jar"


RUNCLASS="curtin.control.VAEAGIServer"


export VAECONFIG="/vad/VAE.conf"


echo "Script: Removing old log files"

rm -f ./logs/VAEServer.log
rm -f ./logs/ChannelSessionManager.log
rm -f ./logs/ThreadManager.log

echo "Script: Deleting old dynamic audio files"
rm -f /var/lib/asterisk/sounds/TMP*.gsm


java -cp $JARS $RUNCLASS NOWAVE




when i run the above shell script (./runagi.sh). It shows me the following
warnings


Warning:



log4j:WARN No appenders could be found for logger
=(net.sf.hibernate.cfg.Environment)
 


log4j:WARN Please initialize the log4j system properly

would anyone tell me how can i solve it?
-- 
View this message in context: 
http://www.nabble.com/initialize-the-log4j-system-properly-tp20712821p20712821.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


initialize the log4j system properly

2008-11-26 Thread Dipocse

Hi All
I've a database (PRJ) and I'm trying to connect from Asterisk server to that
database. In the shell script i used a log4j-1.2.11.jar with all others jar
files. 

The shell script for runagi.sh is :

#!/bin/sh 

JARS="curtin.jar:/lib/log4j-1.2.11.jar:/lib/jta.jar:/lib/antlr-2.7.6rc1.jar:/lib/ehcache-1.1.jar:/lib/cglib-2.1.3.jar:/lib/dom4j-1.6.1.jar:/lib/mail.jar:/lib/commons-lang-1.0.1.jar:/lib/mysql-connector-java-3.1.10-bin.jar:/lib/asm-attrs.jar:/lib/commons-logging-1.0.4.jar:/lib/commons-collections-2.1.1.jar:/lib/mailet_1_0.jar:/lib/asterisk-java-0.2.jar:/lib/jdom.jar:/lib/rome-0.7.jar:/lib/asm.jar:/lib/hibernate3.jar:/lib/activation.jar:/lib/c3p0-0.9.0.jar"


RUNCLASS="curtin.control.VAEAGIServer"


export VAECONFIG="/vad/VAE.conf"


echo "Script: Removing old log files"

rm -f ./logs/VAEServer.log
rm -f ./logs/ChannelSessionManager.log
rm -f ./logs/ThreadManager.log

echo "Script: Deleting old dynamic audio files"
rm -f /var/lib/asterisk/sounds/TMP*.gsm


java -cp $JARS $RUNCLASS NOWAVE




when i run the above shell script (./runagi.sh). It shows me the following
warnings


Warning:



log4j:WARN No appenders could be found for logger
=(net.sf.hibernate.cfg.Environment)
 


log4j:WARN Please initialize the log4j system properly

would anyone tell me how can i solve it?
-- 
View this message in context: 
http://www.nabble.com/initialize-the-log4j-system-properly-tp20712837p20712837.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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