Tech Newbie | 2 Jan 2011 05:22
Picon
Favicon

ExpressionFilter with single quote

I have been using single quote to delimit my MSG param:
<param name="Expression" value="LEVEL == ERROR &amp;&amp; LOGGER ~= STDERR &amp;&amp; MSG ~= ' my test ' "/>

This has been working great.  Now I need to filter out an expression that contains single quotes itself:
URI='/favicon.ico'

Do I escape the single quotes with a backslash?
<param name="Expression" value="LEVEL == ERROR &amp;&amp; LOGGER ~= STDERR &amp;&amp; MSG ~= '
URI=\'/favicon.ico\' ' "/>

TIA

      
valerie.bauche | 3 Jan 2011 15:28
Picon

Encoding problem

Hello

I need to print logs containing accentuated characters with a FileAppender.
I set the encoding property :
log4j.appender.monappender.Encoding=UTF-8

But I still have problems with accents in the resulting log : é instead 
of é
Is this "Encoding" property working ?

Stadelmann Josef | 3 Jan 2011 16:33
Picon

AW: Encoding problem

Can you try

log4j.appender.monappender.Encoding="ISO-8859-1"

in this case your logger output should be a single byte for a é but not 2 as with UTF-8

But I guess that is not your problem. Also you are not telling me with which program your logfile is shown to
the user. 

If your characters are encoded in UTF-8 then any accented character like é is represented by a 2 bytes sequence

So it might happen that your logfile is encoded in UTF-8, hence é is actually 2 bytes stored in a logfile!

Now opening the log file with microsoft word, and telling word (interactively) that the file has an UTF-8
encoding should make word display the proper é but not 2 characters.

If you encode as ISO-8854-1 (as shown above) you need to tell word that the log-file-encoding was done using
ISO-8854-1, and word will display é

Josef

-----Ursprüngliche Nachricht-----
Von: valerie.bauche <at> bull.net [mailto:valerie.bauche <at> bull.net] 
Gesendet: Montag, 3. Januar 2011 15:29
An: log4j-user <at> logging.apache.org
Betreff: Encoding problem

Hello

I need to print logs containing accentuated characters with a FileAppender.
(Continue reading)

valerie.bauche | 3 Jan 2011 16:50
Picon

Réf. : AW: Encoding problem

Ok, you're right ! I opened my log file with ultraedit and it did not 
recognize the UTF-8 encoding. If I change to ISO-8859-1 it's ok.

Thank you !

"Stadelmann Josef" <josef.stadelmann <at> axa-winterthur.ch>
03/01/2011 16:33
Veuillez répondre à "Log4J Users List"

 
        Pour :  "Log4J Users List" <log4j-user <at> logging.apache.org>
        cc : 
        Objet : AW: Encoding problem

Can you try

log4j.appender.monappender.Encoding="ISO-8859-1"

in this case your logger output should be a single byte for a é but not 2 
as with UTF-8

But I guess that is not your problem. Also you are not telling me with 
which program your logfile is shown to the user. 

If your characters are encoded in UTF-8 then any accented character like é 
is represented by a 2 bytes sequence

So it might happen that your logfile is encoded in UTF-8, hence é is 
actually 2 bytes stored in a logfile!

(Continue reading)

maxrizhkov | 6 Jan 2011 15:17
Picon

Writing redirect of stdout and stderr to Log4j appender


Hello,

Please be informed of the following article available for reading at

http://sysgears.com/?p=111

Sincerely yours,

Max
Sysgears
--

-- 
View this message in context: http://old.nabble.com/Writing-redirect-of-stdout-and-stderr-to-Log4j-appender-tp30605462p30605462.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Rick Labanca | 14 Jan 2011 20:42
Favicon

1024 limit on syslogappender isn't good for syslog-ng

In version 1.2.15, the max length was changed to 1024 per the syslog spec,
but we use syslog-ng (as I think many do to avoid some shortcomings of
syslog). So we got truncated messages. Rolling back to 14 fixed this.

Could there be a flag added to disable this limit in a future revision? Or
perhaps there is a way and I'm not finding it.

rick
Gary Gregory | 14 Jan 2011 21:11

RE: 1.2.16 with broken OSGi Import-Package?

I count only on " com.sun.jdmk.comm;resolution:=optional" in:

Import-Package: com.ibm.uvm.tools;resolution:=optional,com.sun.jdmk.co
 mm;resolution:=optional,com.sun.jdmk.comm;resolution:=optional,javax.
 jmdns,javax.jms;resolution:=optional,javax.mail;resolution:=optional,
 javax.mail.internet;resolution:=optional,javax.management;resolution:
 =optional,javax.naming;resolution:=optional,javax.swing;resolution:=o
 ptional,javax.swing.border;resolution:=optional,javax.swing.event;res
 olution:=optional,javax.swing.table;resolution:=optional,javax.swing.
 text;resolution:=optional,javax.swing.tree;resolution:=optional,javax
 .xml.parsers,org.apache.log4j,org.apache.log4j.config,org.apache.log4
 j.helpers,org.apache.log4j.jdbc,org.apache.log4j.jmx,org.apache.log4j
 .net,org.apache.log4j.nt,org.apache.log4j.or,org.apache.log4j.or.jms,
 org.apache.log4j.or.sax,org.apache.log4j.pattern,org.apache.log4j.spi
 ,org.apache.log4j.varia,org.apache.log4j.xml,org.w3c.dom,org.xml.sax,
 org.xml.sax.helpers

Gary Gregory
Senior Software Engineer
Rocket Software
3340 Peachtree Road, Suite 820 • Atlanta, GA 30326 • USA
Tel: +1.404.760.1560
Email: ggregory <at> seagullsoftware.com
Web: seagull.rocketsoftware.com  



> -----Original Message-----
> From: Lars Fischer [mailto:reschifl <at> googlemail.com]
> Sent: Thursday, July 08, 2010 07:18
(Continue reading)

Curt Arnold | 16 Jan 2011 05:29
Picon
Favicon

Re: 1.2.16 with broken OSGi Import-Package?

The duplication was reported in https://issues.apache.org/bugzilla/show_bug.cgi?id=43282 and is
fixed in the SVN HEAD.

On Jan 14, 2011, at 2:11 PM, Gary Gregory wrote:

> I count only on " com.sun.jdmk.comm;resolution:=optional" in:
> 
> Import-Package: com.ibm.uvm.tools;resolution:=optional,com.sun.jdmk.co
> mm;resolution:=optional,com.sun.jdmk.comm;resolution:=optional,javax.
> jmdns,javax.jms;resolution:=optional,javax.mail;resolution:=optional,
> javax.mail.internet;resolution:=optional,javax.management;resolution:
> =optional,javax.naming;resolution:=optional,javax.swing;resolution:=o
> ptional,javax.swing.border;resolution:=optional,javax.swing.event;res
> olution:=optional,javax.swing.table;resolution:=optional,javax.swing.
> text;resolution:=optional,javax.swing.tree;resolution:=optional,javax
> .xml.parsers,org.apache.log4j,org.apache.log4j.config,org.apache.log4
> j.helpers,org.apache.log4j.jdbc,org.apache.log4j.jmx,org.apache.log4j
> .net,org.apache.log4j.nt,org.apache.log4j.or,org.apache.log4j.or.jms,
> org.apache.log4j.or.sax,org.apache.log4j.pattern,org.apache.log4j.spi
> ,org.apache.log4j.varia,org.apache.log4j.xml,org.w3c.dom,org.xml.sax,
> org.xml.sax.helpers
> 
> Gary Gregory
> Senior Software Engineer
> Rocket Software
> 3340 Peachtree Road, Suite 820 • Atlanta, GA 30326 • USA
> Tel: +1.404.760.1560
> Email: ggregory <at> seagullsoftware.com
> Web: seagull.rocketsoftware.com  
> 
(Continue reading)

Roger Pau Monné | 18 Jan 2011 09:53
Picon

Remote logging

Hello,

I'm working on setting up remote logging with Log4j version 1.2.16,
I've been able to create the server and the client using SecureSockets
with a modification of SocketAppender, and I would like to log the
class and line number where the logging event has happened. I've tried
adding (%F:%L) to the layout.ConversionPattern property in the server
and the client, but I only get (?:?) in the log file, is there anyway
to get the class name and line number when using remote logging?

Thanks, Roger.
Jorge Medina | 18 Jan 2011 20:31
Picon

Directing logging of a single class to a different file

Hello,

 I am trying to direct the output of a single class (MyClass)  to a
different log file.
 I added the following lines to my log4j configuration

###############################################################################
# Metrics Logger Appender
###############################################################################
log4j.logger.com.example.interceptor.MyClass=DEBUG, R2
log4j.appender.R2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R2.File=/some/path/metrics
log4j.appender.R2.DatePattern='-'yyyy-MM-dd'.log'
log4j.appender.R2.layout=org.apache.log4j.PatternLayout
log4j.appender.R2.layout.ConversionPattern=[%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ}]
[%X{username}] [%X{clientId}] %-5p %c{1} %m%n
log4j.additivity.com.example.interceptor.MyClass=false

###############################################################################
# Metrics Logger Package Selection
###############################################################################
log4j.logger.com.example.interceptor.MyClass=DEBUG

But I get the error messages:

log4j:WARN No appenders could be found for logger
(com.example.interceptor.MyClass).
log4j:WARN Please initialize the log4j system properly.

 Nevertheless it works when I remove the class name on the first line:
(Continue reading)


Gmane