How to log JApplet to a JFrame

2006-09-14 Thread Mansour
I am writing an applet, and hoping I can find a way to log to a JFrame. 
My applet consists of many classes. So I 'll have to wrap them in a jar.

Is there a direct way to do this ??


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



How configure the categories for console, logFile and htmlFile showing different levels

2006-09-14 Thread Bender Heri
Since you defined additivity=false on your com.schinvest Logger, the log 
messages don't reach the root logger.

Your goal can be achieved by xml configuration where you can declare filters on 
appenders. So you only declare a root logger with debug level and a net.sf 
logger with warn level. On the htmlLogFile and console appenders you declare a 
level range filter.

Heri

 -Original Message-
 From: David [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 13, 2006 6:05 PM
 To: log4j-user@logging.apache.org
 Subject: [SPAM (Bayesain Analysis)] - How configure the categories for
 console, logFile and htmlFile showing different levels - 
 Bayesian Filter
 detected spam
 
 
 Dear members,

   I would like to separate the information from log4j ouptut 
 into the following appenders (files)

   htmlLogFile, console: myapp for INFO level, net.sf for WARN level
   logFile:  myapp for DEBUG level, net.sf for WARN
level

   so I want a defailed information on DEBUG about my 
 application, and for other appenders just INFO level for my 
 app and for external libraries WARN level. It is usefull for 
 me because the html file is for customer and console, logFile 
 is for developers.

   I am using categories, but I can't find the appropiate 
 combination for that. I expect the following configuration 
 should work:

   log4j.rootCategory=DEBUG, logFile, htmlLogFile, console
   # com.schinvest is my application
   log4j.additivity.com.schinvest=false 
   

   log4j.category.com.schinvest = INFO, htmlLogFile, console
   log4j.category.net.sf =WARN, logFile, htmlLogFile, console
   log4j.additivity.net.sf =false

   I get the expected result for console and htmlLogFile, but 
 I don't see the INFO level for my app on logFile I see only 
 the WARN level for external libraries.

   so why I don't see the debug level on my logFile, it is 
 defined on the root category for all appenders, it seems that 
 the line: 

   log4j.category.com.schinvest = INFO, htmlLogFile, console

   overrides the behaviour for logFile

   Thanks in advance,

   David
 
   
 -
 Get your email and more, right on the  new Yahoo.com 
 

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



Sending special messages to a different appender

2006-09-14 Thread Bender Heri
declare a separate logger with your SPECIAL_APPENDER attached and additivity 
flag false. You are not forced to use the classname as logger name. You can 
choose any string (i.e. SPECIAL_LOGGER). 
Heri

 -Original Message-
 From: Bryce Nesbitt [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 14, 2006 7:02 AM
 To: log4j-user@logging.apache.org
 Subject: [SPAM (Bayesain Analysis)] - Sending special messages to a
 different appender - Bayesian Filter detected spam
 
 
 I wish to write a separate log of certain special and important
 messages.  In perl, this might go:
 
 print NORMALLOG foo;
 print NORMALLOG fum
 print SPECIALLOG special message;
 
 Can this be done with log4j?  This would be something looking 
 roughly like:
 
 logger.info(fum);
 logger.debug(foo);
 logger.debug(loo);
 logger.info(SPECIAL_APPENDER,foo);
 
 I can't divide these messages based on the class that's 
 printing them. 
 I somehow need to create a new and totally separate log file.  Is this
 possible?
 
   -Bryce
 
 
 PS1:  Why?  This is a poorman's mirroring system.  The idea 
 is to dump a
 certain special checkpoint messages to a remote syslog server 
 for archiving.
 
 PS1: the log4j.properties file is:
 
 log4j.appender.A1 = org.apache.log4j.RollingFileAppender
 log4j.appender.A1.file = /tmp/fooble.log
 log4j.appender.A1.layout = org.apache.log4j.PatternLayout
 log4j.appender.A1.layout.conversionPattern = %d %-5p %m - %c{2}%n
 log4j.appender.A1.append = false
 
 log4j.appender.SPECIAL_APPENDER=org.apache.log4j.net.SyslogAppender
 log4j.appender.SPECIAL_APPENDER.SPECIAL_APPENDERHost=209.99.99.31
 log4j.appender.SPECIAL_APPENDER.layout=org.apache.log4j.PatternLayout
 log4j.appender.SPECIAL_APPENDER.layout.ConversionPattern=%p: %c - %m
 log4j.appender.SPECIAL_APPENDER.Facility=SPECIAL_APPENDER
 
 log4j.rootLogger=ERROR, A1
 log4j.category.org.foo.fum = SPECIAL_APPENDER
 
 This works fine, except org.foo.fum needs to continue to send regular
 output to A1, without cluttering SPECIAL_APPENDER.
 
 
 -
 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]



Re: How to set permission of log files

2006-09-14 Thread Thomas Kathmann

James Stauffer wrote:

Correct me if I am wrong.
You have different users running your application but they all write
to the same log file.  Can you make each user log to their own file
(i.e. in their home directory)?
If it isn't important what you log, and want to allow users to modify 
their log files, I think this is the best way to do it.


On the other hand, if you log some important information I would rather 
log to syslog instead of a normal log file.


Greetings,
Thomas Kathmann

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



Re: Logging issue

2006-09-14 Thread Shashank
Shashank davanagere at gmail.com writes:

Hmm.. it doesnt sound too secure unless we coudl use ssh to secure the ports.
Then that might be a bottleneck. We obviously cannot have logs that are not
secure... :roll:




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



Re: Logging issue

2006-09-14 Thread patrick

if both machines are on a local network you just have to make sure the used
port is not open to the outside world.
with reasonable firewall setting this should be the default anyway
so no need for ssh...

another solution might be to log into a database


Shashank-3 wrote:
 
 Shashank davanagere at gmail.com writes:
 
 Hmm.. it doesnt sound too secure unless we coudl use ssh to secure the
 ports.
 Then that might be a bottleneck. We obviously cannot have logs that are
 not
 secure... :roll:
 
 

-- 
View this message in context: 
http://www.nabble.com/Logging-issue-tf2267558.html#a6306757
Sent from the Log4j - Users forum at Nabble.com.


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



Re: How to log JApplet to a JFrame

2006-09-14 Thread James Stauffer

Write your own appender that passes the messages to the JFrame.

On 9/14/06, Mansour [EMAIL PROTECTED] wrote:

I am writing an applet, and hoping I can find a way to log to a JFrame.
My applet consists of many classes. So I 'll have to wrap them in a jar.
Is there a direct way to do this ??


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





--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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



Re: Sending special messages to a different appender

2006-09-14 Thread James Stauffer

I suggest that you create 2 loggers per class.
Logger logger = Logger.getLogger(getClass());
Logger loggerSpecial = Logger.getLogger(special. + getClass().getName());

log4j.rootLogger=ERROR
log4j.category.org = A1
log4j.category.special = SPECIAL_APPENDER

(I am not positive if I have the properties entries correct.)

On 9/14/06, Bryce Nesbitt [EMAIL PROTECTED] wrote:

I wish to write a separate log of certain special and important
messages.  In perl, this might go:

print NORMALLOG foo;
print NORMALLOG fum
print SPECIALLOG special message;

Can this be done with log4j?  This would be something looking roughly like:

logger.info(fum);
logger.debug(foo);
logger.debug(loo);
logger.info(SPECIAL_APPENDER,foo);

I can't divide these messages based on the class that's printing them.
I somehow need to create a new and totally separate log file.  Is this
possible?

  -Bryce


PS1:  Why?  This is a poorman's mirroring system.  The idea is to dump a
certain special checkpoint messages to a remote syslog server for archiving.

PS1: the log4j.properties file is:

log4j.appender.A1 = org.apache.log4j.RollingFileAppender
log4j.appender.A1.file = /tmp/fooble.log
log4j.appender.A1.layout = org.apache.log4j.PatternLayout
log4j.appender.A1.layout.conversionPattern = %d %-5p %m - %c{2}%n
log4j.appender.A1.append = false

log4j.appender.SPECIAL_APPENDER=org.apache.log4j.net.SyslogAppender
log4j.appender.SPECIAL_APPENDER.SPECIAL_APPENDERHost=209.99.99.31
log4j.appender.SPECIAL_APPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.SPECIAL_APPENDER.layout.ConversionPattern=%p: %c - %m
log4j.appender.SPECIAL_APPENDER.Facility=SPECIAL_APPENDER

log4j.rootLogger=ERROR, A1
log4j.category.org.foo.fum = SPECIAL_APPENDER

This works fine, except org.foo.fum needs to continue to send regular
output to A1, without cluttering SPECIAL_APPENDER.


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





--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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



Re: Small Struts Project + Logging

2006-09-14 Thread James Stauffer

If you configure commons-logging to use log4j then the rest should be
normal config of log4j.

On 9/14/06, Raghuveer [EMAIL PROTECTED] wrote:


Since for struts framework commons-logging.jar is used
How can I use Commons logging so that logs related to my application are
sent to seprate log file.
How to configure my logger realted to application alone.







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





--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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



RE: How configure the categories for console, logFile and htmlFile showing different levels

2006-09-14 Thread Bender Heri
Here is an example of an xml configuration which uses filters (BTW: Using this 
two appenders when debugging in eclipse  the console shows the DEBUG and INFO 
in black color and the others in red color). You can also write your own filter 
class where you are free to filter what you want. Be careful on the ordering 
when extending this xml file. The logj4 parser expects first all appenders 
followed by all loggers.
 
?xml version = 1.0 encoding = UTF-8?
 
!DOCTYPE log4j:configuration SYSTEM log4j.dtd
 
log4j:configuration xmlns:log4j= http://jakarta.apache.org/log4j/; 
debug=false
 
appender name=CONSOLE.ERR class=org.apache.log4j.ConsoleAppender
param name=target value=System.err/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d{HH:mm:ss.SSS} (%6r) %-5p 
%-10X{category} [%-7t] %F:%L %x - %m%n/
/layout
filter class=org.apache.log4j.varia.LevelRangeFilter
param name=LevelMin value=warn/
param name=LevelMax value=fatal/
param name=AcceptOnMatch value=false/
/filter
/appender
 
appender name=CONSOLE.OUT class=org.apache.log4j.ConsoleAppender
param name=target value=System.out/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d{HH:mm:ss.SSS} (%6r) %-5p 
%-10X{category} [%-7t] %F:%L %x - %m%n/
/layout
filter class=org.apache.log4j.varia.LevelRangeFilter
param name=LevelMin value=debug/
param name=LevelMax value=info/
param name=AcceptOnMatch value=false/
/filter
/appender
 
root
level value=debug/
appender-ref ref=CONSOLE.ERR/
appender-ref ref=CONSOLE.OUT/
/root
 
/log4j:configuration



Re: Logging issue

2006-09-14 Thread Shashank
thanks patrick. i think thats the way we woudl want to go in.. or by using
jmsappender to log in messages. as long as it doesnt add much overhead to the
system we should be good going the jms way...




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



Separate log files per thread.

2006-09-14 Thread Edward L. Knoll
We want to set up or log4j configuration with thread specific log files.
I've been through many archives and have seen several suggestions, but
I'm still looking for a solution better aligned to our needs.  I'll
summarize the solutions I've already stumbled across in case there was
something I overlooked.   If you have suggestions, please provide a
little bit of detail or references to same.

1) Don't do it.  Add some kind of content to the message (e.g. thread
name in the conversion pattern, output context added via the NDC or MDC
classes).  Filter the single log file everything is logged to as a
post-processing exercise.   Might work for one of our situations.

2) Define multiple appenders in the configuration file and create the
loggers by name.  Might work in some of our situations where the
threading configuration is static or predictable (and small).  

3) Did see an older reference to something referred to as a 'context
sensitive appender' which someone had provided code for.  This was
promising, because a simple context-sensitive configuration definition
would cover multiple loggers/appenders/files.  Unfortunately, I was
unable to unzip the attached zip file and the author references had been
sanitized (and likely too old to be valid anyway).



ApacheCON US 2006

2006-09-14 Thread Curt Arnold
ApacheCON US 2006 (http://www.apachecon.com) will be held on October  
9-13 in Austin, TX.  Registration prices increase yet again tomorrow  
and hotel reservations should be made soon to take advantage of the  
special conference room rates.  I've tentatively scheduled a Logging  
Services BOF for Thursday night (http://wiki.apache.org/apachecon/ 
BirdsOfaFeatherUs06) and plan to be at the Hackathon on Monday and  
Tuesday.


If you have specific topics that you'd like to discuss at ApacheCON  
or other suggestions, please post them on  
[EMAIL PROTECTED]  Hope to see some of you there. 


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



Re: Separate log files per thread.

2006-09-14 Thread James Stauffer

4. Write your own appender that potentially changes the logfile name
per logging event.  I do a smiliar thing with an appender.
http://stauffer.james.googlepages.com/DateFormatFileAppender.java

On 9/14/06, Edward L. Knoll [EMAIL PROTECTED] wrote:

We want to set up or log4j configuration with thread specific log files.
I've been through many archives and have seen several suggestions, but
I'm still looking for a solution better aligned to our needs.  I'll
summarize the solutions I've already stumbled across in case there was
something I overlooked.   If you have suggestions, please provide a
little bit of detail or references to same.

1) Don't do it.  Add some kind of content to the message (e.g. thread
name in the conversion pattern, output context added via the NDC or MDC
classes).  Filter the single log file everything is logged to as a
post-processing exercise.   Might work for one of our situations.

2) Define multiple appenders in the configuration file and create the
loggers by name.  Might work in some of our situations where the
threading configuration is static or predictable (and small).

3) Did see an older reference to something referred to as a 'context
sensitive appender' which someone had provided code for.  This was
promising, because a simple context-sensitive configuration definition
would cover multiple loggers/appenders/files.  Unfortunately, I was
unable to unzip the attached zip file and the author references had been
sanitized (and likely too old to be valid anyway).






--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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



RE: Small Struts Project + Logging

2006-09-14 Thread Raghuveer
My requirement is to have seprate config file for my app.

My src directoy is like

com.xyz.x.test1.class
com.xyz.v.test1.class

I need to log only my application related logs in seprate file called
test.log.

I dont want struts internal logs in my application log file test.log


Raghu



-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 14, 2006 8:21 PM
To: Log4J Users List; [EMAIL PROTECTED]
Subject: Re: Small Struts Project + Logging


If you configure commons-logging to use log4j then the rest should be
normal config of log4j.

On 9/14/06, Raghuveer [EMAIL PROTECTED] wrote:

 Since for struts framework commons-logging.jar is used
 How can I use Commons logging so that logs related to my application are
 sent to seprate log file.
 How to configure my logger realted to application alone.







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




--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/


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