Ricardo Oliveira | 2 Feb 10:24
Picon

ExpressionFilter in log4j.properties

Hello,

Is there any way to configure expression filters in log4j.properties or we need to use log4j.xml?

Cheers,

--Ricardo
Stadelmann Josef | 2 Feb 14:19
Picon

AW: Configuration Sequence

Looks as if nobody knows it ...

well, I have the sources and can look myself, 
but I was so confident that a developer would know it :-(

Josef

-----Ursprüngliche Nachricht-----
Von: Stadelmann Josef [mailto:josef.stadelmann <at> axa-winterthur.ch] 
Gesendet: Donnerstag, 26. Januar 2012 13:37
An: log4j-user <at> logging.apache.org
Betreff: Configuration Sequence

I have a simpel question :

what is the prioper sequence in configuring log4j.properties

1.	logger
2.	additivity
3.	appenders
4.	filters

to reach that all gets parsed but not twice, 

if sequences are not correct, I see errors such as, in case of a rolling
file appender
file locked by another user, or in case of a Chainsaw sockethuappender,
socket 
address already in use.

(Continue reading)

Scott Deboy | 2 Feb 16:38
Picon

Re: ExpressionFilter in log4j.properties

I don't think you can define nested elements in the configuration file
format, which are usually where expressionfilters end up.  What are you
trying to define?

Scott

On Thu, Feb 2, 2012 at 1:24 AM, Ricardo Oliveira <rvelosoo <at> gmail.com> wrote:

> Hello,
>
> Is there any way to configure expression filters in log4j.properties or we
> need to use log4j.xml?
>
> Cheers,
>
> --Ricardo
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
> For additional commands, e-mail: log4j-user-help <at> logging.apache.org
>
>
Picon

Re: JDK logging appender that sends events to log4j

Looking at http://people.apache.org/~psmith/logging.apache.org/sandbox/jul-log4j-bridge/examples.html
I tried adding:
    <plugin name="julreceiver" class="org.apache.log4j.jul.JULReceiver" />
but I get:
log4j: Using URL [file:/C:/Tomcat/lib/log4j.xml] for automatic log4j
configuration.
log4j: Preferred configurator class: org.apache.log4j.xml.DOMConfigurator
log4j: System property is :null
log4j: Standard DocumentBuilderFactory search succeded.
log4j: DocumentBuilderFactory is:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
log4j:WARN Continuable parsing error 132 and column 23
log4j:WARN The content of element type "log4j:configuration" must
match "(renderer*,appender*,plugin*,(category|logger)*,root?,(categoryFactory|loggerFactory)?)".
log4j: debug attribute= "true".
log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j:WARN Unrecognized element plugin

I am using log4j 1.2.15 and apache-jul-log4j-bridge-1.0.0-20080915.045446-7.jar

James A. N. Stauffer        http://jamesjive.blogspot.com
Are you good? Take the test at http://www.livingwaters.com/good/

On Tue, Jun 19, 2007 at 5:08 PM, Paul Smith <psmith <at> aconex.com> wrote:
> The SVN checkout url is here:
>
> http://svn.apache.org/repos/asf/logging/sandbox/jul-to-log4j-bridge/
>
> It does rely on the latest 1.2.15 snapshot.  The dependency snapshot
(Continue reading)

Scott Deboy | 2 Feb 16:52
Picon

Re: Configuration Sequence

Order in the file doesn't really matter in either case it seems.

For a properties file, PropertyConfigurator does process entries in a
specific order, but it just finds them in the properties file and builds
the entries - here is the code from PropertyConfigurator:

configureRootCategory(properties, hierarchy);
configureLoggerFactory(properties);
parseCatsAndRenderers(properties, hierarchy);

For an xml file, the elements will be processed as they are defined in the
xml file - the DOMConfigurator code parses whatever is found in that order.

Scott

On Thu, Feb 2, 2012 at 5:19 AM, Stadelmann Josef <
josef.stadelmann <at> axa-winterthur.ch> wrote:

> Looks as if nobody knows it ...
>
> well, I have the sources and can look myself,
> but I was so confident that a developer would know it :-(
>
> Josef
>
> -----Ursprüngliche Nachricht-----
> Von: Stadelmann Josef [mailto:josef.stadelmann <at> axa-winterthur.ch]
> Gesendet: Donnerstag, 26. Januar 2012 13:37
> An: log4j-user <at> logging.apache.org
> Betreff: Configuration Sequence
(Continue reading)

Stadelmann Josef | 2 Feb 17:10
Picon

AW: Configuration Sequence

Thank you Scott

the reason why I ask is because I see a lot "already parsed" messages when debug=true is set.
So I was assuming that there is a way to pass configuration records in a proper sequence and 
avoid this messages altogether.

The other reason is if I see errors with the Socket hub appender that a port is already in use. 
A clear indicator that a configuration record has already been parsed for a given port, resulting
in a port becoming open and its socket gets in-use, hence, a next time parsing will result in a exception.
"address already in use"!  I do not yet have a different explanation for that exceptions.

Josef

-----Ursprüngliche Nachricht-----
Von: Scott Deboy [mailto:scott.deboy <at> gmail.com] 
Gesendet: Donnerstag, 2. Februar 2012 16:52
An: Log4J Users List
Betreff: Re: Configuration Sequence

Order in the file doesn't really matter in either case it seems.

For a properties file, PropertyConfigurator does process entries in a
specific order, but it just finds them in the properties file and builds
the entries - here is the code from PropertyConfigurator:

configureRootCategory(properties, hierarchy);
configureLoggerFactory(properties);
parseCatsAndRenderers(properties, hierarchy);

For an xml file, the elements will be processed as they are defined in the
(Continue reading)

siv99 | 8 Feb 23:42
Picon

log4j:ERROR Could not parse file


Hi,
   I am trying to use log4j in my application and i am getting following
error. Thanks a lot for the help in advance.

log4j:ERROR Could not parse file [nullWEB-INF/logging/log4j.xml].
java.io.FileNotFoundException:
/app/ENP/user_projects/domains/Domain2/nullWEB-INF/logging/log4j.xml (No
such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:106)
        at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:66)
        at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
        at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
        at java.net.URL.openStream(URL.java:1010)
        at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2650)
        at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:253)
        at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:222)
        at
oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:155)
        at
weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:163)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
        at
org.apache.log4j.xml.DOMConfigurator$1.parse(DOMConfigurator.java:749)
        at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:866)
        at
(Continue reading)

Picon

Re: log4j:ERROR Could not parse file

Well, the references to *nullWEB-INF* seems pretty suspicious. I would
check the vAlue of prefix on the class Log4jInit.

2012/2/8 siv99 <sivaswamy99 <at> gmail.com>

>
> Hi,
>   I am trying to use log4j in my application and i am getting following
> error. Thanks a lot for the help in advance.
>
>
> log4j:ERROR Could not parse file [nullWEB-INF/logging/log4j.xml].
> java.io.FileNotFoundException:
> /app/ENP/user_projects/domains/Domain2/nullWEB-INF/logging/log4j.xml (No
> such file or directory)
>        at java.io.FileInputStream.open(Native Method)
>        at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:106)
>        at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:66)
>        at
>
> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
>        at
>
> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
>        at java.net.URL.openStream(URL.java:1010)
>        at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2650)
>        at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:253)
>        at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:222)
>        at
> oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:155)
(Continue reading)

zrbite1 | 10 Feb 23:41
Picon

Log4j Multiple log files, shared classes


My implementation uses Spring. I am trying to log to two different files, so
when my package abc.test1 logs a file, my logger will write to test1.log.
Same is true for abc.test2. 

However, both of them uses org.springframework. I want to be able to see
logging for org.springframework also, but only the relevant logs. This is
what it looks like now:

<logger name="abc.test1">
  <level value="debug"/>
  <appender-ref ref="test1"/>
</logger>
<logger name="abc.test2">
  <level value="debug"/>
  <appender-ref ref="test2"/>
</logger>
<logger name="org.springframework">
  <level value="debug"/>
  <appender-ref ref="test1"/>
  <appender-ref ref="test2"/>
</logger>

 The way it is now, if abc.test1 makes a web service call, any
org.springframework messages will show up in both. How can I filter out
messages so that springframework messages show up in the correct log file
based on which web service (test1 or test2) actually called it?
--

-- 
View this message in context: http://old.nabble.com/Log4j-Multiple-log-files%2C-shared-classes-tp33303917p33303917.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
(Continue reading)

Edmondo Porcu | 13 Feb 10:31
Favicon

Programmatically create a ConsoleAppender

Dear all,
I have a test-case where I want to add extra logging compared to my normal logging settings.

I have therefore create manually an appender, and add that to a logger. However, 
PRIORITY.DEBUG is deprecated.

I am probably missing some information about how to add extra logging:

  private final val mockRealTimeLogger= Logger.getLogger("MockRealTimeConnectorLogger")
  mockRealTimeLogger.setLevel(Level.DEBUG)
  val appender = new ConsoleAppender(new PatternLayout("%d{ABSOLUTE} [%t] %-5p %c{1} - %m%n"));
  appender.setThreshold(Priority.DEBUG)
  mockRealTimeLogger.addAppender(appender)

Isn't this good? 

Thank you very much

Edmondo Porcu
Associate - Financial  software architect

Avenue de Rhodanie 48
1007 Lausanne
Switzerland.

Dir  +41 (0) 21  560 30 82
Fax +41 (0) 21  617 71 55
Email : edmondo.porcu <at> gottexbrokers.com

The information in this email is confidential and may be legally privileged. If you are not the intended
(Continue reading)


Gmane