Log Filtering base on issuing class (%C)

I can't seem to find out how to filter my logs bases on the class name that issued the logged statement. Is any of of the pre-shipped filters suitable for this task? Regards, Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes (56-2) 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl

Hi Gonzalo, Have you looked at the basic selection rule [1]? HTH, [1] http://logback.qos.ch/manual/architecture.html#basic_selection -- Ceki http://twitter.com/#!/ceki On 30.05.2012 17:29, Gonzalo Vasquez wrote:
I can't seem to find out how to filter my logs bases on the class name that issued the logged statement. Is any of of the pre-shipped filters suitable for this task?
Regards,
*Gonzalo Vásquez Sáez* *Gerente Investigación y Desarrollo (R&D)* *Altiuz*Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes

Yes I have. All I need to log is in the DEBUG level of JackRabbit, but I only need messages from specific classes, that's my problem :( Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes (56-2) 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl El 30-05-2012, a las 13:25, ceki escribió:
Hi Gonzalo,
Have you looked at the basic selection rule [1]?
HTH,
[1] http://logback.qos.ch/manual/architecture.html#basic_selection
-- Ceki http://twitter.com/#!/ceki
On 30.05.2012 17:29, Gonzalo Vasquez wrote:
I can't seem to find out how to filter my logs bases on the class name that issued the logged statement. Is any of of the pre-shipped filters suitable for this task?
Regards,
*Gonzalo Vásquez Sáez* *Gerente Investigación y Desarrollo (R&D)* *Altiuz*Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

Sounds like setting the root level to INFO or higher and setting the level of the appropriate JackRabbit loggers to DEBUG would work. Right? On 30.05.2012 21:30, Gonzalo Vasquez wrote:
Yes I have. All I need to log is in the DEBUG level of JackRabbit, but I only need messages from specific classes, that's my problem :(
Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes (56-2) 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl
El 30-05-2012, a las 13:25, ceki escribió:
Hi Gonzalo,
Have you looked at the basic selection rule [1]?
HTH,
[1] http://logback.qos.ch/manual/architecture.html#basic_selection
-- Ceki http://twitter.com/#!/ceki
On 30.05.2012 17:29, Gonzalo Vasquez wrote:
I can't seem to find out how to filter my logs bases on the class name that issued the logged statement. Is any of of the pre-shipped filters suitable for this task?
Regards,
-- Ceki http://twitter.com/#!/ceki

I've already tried that approach, but the problem is that there seems to be a single JackRabbit logger named 'logger$', or am I wrong? Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes (56-2) 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl El 30-05-2012, a las 15:40, ceki escribió:
Sounds like setting the root level to INFO or higher and setting the level of the appropriate JackRabbit loggers to DEBUG would work. Right?
On 30.05.2012 21:30, Gonzalo Vasquez wrote:
Yes I have. All I need to log is in the DEBUG level of JackRabbit, but I only need messages from specific classes, that's my problem :(
Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes (56-2) 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl
El 30-05-2012, a las 13:25, ceki escribió:
Hi Gonzalo,
Have you looked at the basic selection rule [1]?
HTH,
[1] http://logback.qos.ch/manual/architecture.html#basic_selection
-- Ceki http://twitter.com/#!/ceki
On 30.05.2012 17:29, Gonzalo Vasquez wrote:
I can't seem to find out how to filter my logs bases on the class name that issued the logged statement. Is any of of the pre-shipped filters suitable for this task?
Regards,
-- Ceki http://twitter.com/#!/ceki _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

On 30.05.2012 21:49, Gonzalo Vasquez wrote:
I've already tried that approach, but the problem is that there seems to be a single JackRabbit logger named 'logger$', or am I wrong?
Gonzalo Vásquez Sáez
Looking at the source code, JackRabbit has one logger per class named after the class following the common SLF4J/log4j paradigm. -- Ceki http://twitter.com/#!/ceki

Strange, but I'll check as I'm getting the following kind of messages: 16:09:35,447 INFO [STDOUT] 2012-05-30 16:09:35.447 [RMI TCP Connection(4)-127.0.0.1] QueryResultImpl $logger retrieved ScoreNodes in 0 ms (0) 16:09:35,448 INFO [STDOUT] 2012-05-30 16:09:35.447 [RMI TCP Connection(4)-127.0.0.1] SessionState $logger Performed query.execute(//folders/folder[@name='Tarjeta de Crédito - Santander']) in 9730000us 16:09:35,448 INFO [STDOUT] 2012-05-30 16:09:35.448 [RMI TCP Connection(4)-127.0.0.1] QueryImpl $logger executed in 10 ms. (//folders/folder[@name='Tarjeta de Crédito - Santander']) 16:09:35,453 INFO [STDOUT] 2012-05-30 16:09:35.452 [RMI TCP Connection(4)-127.0.0.1] SessionState $logger Performing org.apache.jackrabbit.core.query.lucene.NodeIteratorImpl$FetchNext@2f2a4f3e 16:09:35,453 INFO [STDOUT] 2012-05-30 16:09:35.453 [RMI TCP Connection(4)-127.0.0.1] QueryResultImpl $logger getResults(2147483647) limit=-1 16:09:35,453 INFO [STDOUT] 2012-05-30 16:09:35.453 [RMI TCP Connection(4)-127.0.0.1] TermDocsCache $logger #2 TermDocs(_:PROPERTIES,0:name[Tarjeta de Crédito - Santander) 16:09:35,454 INFO [STDOUT] 2012-05-30 16:09:35.454 [RMI TCP Connection(4)-127.0.0.1] TermDocsCache $logger #2 TermDocs(_:PROPERTIES,0:name[Tarjeta de Crédito - Santander) 16:09:35,455 INFO [STDOUT] 2012-05-30 16:09:35.454 [RMI TCP Connection(4)-127.0.0.1] QueryResultImpl $logger query executed in 1 ms (2) 16:09:35,455 INFO [STDOUT] 2012-05-30 16:09:35.455 [RMI TCP Connection(4)-127.0.0.1] QueryResultImpl $logger retrieved ScoreNodes in 0 ms (0) 16:09:35,455 INFO [STDOUT] 2012-05-30 16:09:35.455 [RMI TCP Connection(4)-127.0.0.1] SessionState $logger Performed org.apache.jackrabbit.core.query.lucene.NodeIteratorImpl$FetchNext@2f2a4f3e in 2086000us 16:09:35,456 INFO [JRabbitConnector] Creating connector, reading from: /ALTIUZ-REPORTS/CARTOLAS/CARTOLA_CTAVISTA_CORPBANCA/reports-cvista_corpbanca-cfg.xml 16:09:35,463 INFO [STDOUT] 2012-05-30 16:09:35.462 [RMI TCP Connection(4)-127.0.0.1] SessionState $logger Performing node.createQuery(//folders/folder[@name='Cuenta Vista - Corpbanca'], xpath) 16:09:35,464 INFO [STDOUT] 2012-05-30 16:09:35.463 [RMI TCP Connection(4)-127.0.0.1] SessionState $logger Performed node.createQuery(//folders/folder[@name='Cuenta Vista - Corpbanca'], xpath) in 640000us 16:09:35,466 INFO [STDOUT] 2012-05-30 16:09:35.465 [RMI TCP Connection(4)-127.0.0.1] SessionState $logger Performing query.execute(//folders/folder[@name='Cuenta Vista - Corpbanca']) 16:09:35,466 INFO [STDOUT] 2012-05-30 16:09:35.466 [RMI TCP Connection(4)-127.0.0.1] QueryImpl $logger Executing query: Using this pattern: <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> So it seems that $logger is the logger name, isn't it? Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes (56-2) 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl El 30-05-2012, a las 16:03, ceki escribió:
On 30.05.2012 21:49, Gonzalo Vasquez wrote:
I've already tried that approach, but the problem is that there seems to be a single JackRabbit logger named 'logger$', or am I wrong?
Gonzalo Vásquez Sáez
Looking at the source code, JackRabbit has one logger per class named after the class following the common SLF4J/log4j paradigm.
-- Ceki http://twitter.com/#!/ceki _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

The pattern %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" does not match the output sent in your message. You probably have another config file lying around with $logger instead of %logger in the pattern. On 30.05.2012 22:14, Gonzalo Vasquez wrote:
Strange, but I'll check as I'm getting the following kind of messages:
16:09:35,447 INFO [STDOUT] 2012-05-30 16:09:35.447 [RMI TCP Connection(4)-127.0.0.1] QueryResultImpl $logger retrieved ScoreNodes in 0 ms (0)
[snip]
Using this pattern:
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
So it seems that $logger is the logger name, isn't it?
-- Ceki http://twitter.com/#!/ceki

Absolutely right!!! The pattern was: <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-40([%thread] %C{0} $logger) %msg%n</pattern> Instead of <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-40([%thread] %C{0} %logger) %msg%n</pattern> Now I'll try filtering based on the logger approach! Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes (56-2) 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl El 30-05-2012, a las 16:28, ceki escribió:
The pattern %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" does not match the output sent in your message. You probably have another config file lying around with $logger instead of %logger in the pattern.
On 30.05.2012 22:14, Gonzalo Vasquez wrote:
Strange, but I'll check as I'm getting the following kind of messages:
16:09:35,447 INFO [STDOUT] 2012-05-30 16:09:35.447 [RMI TCP Connection(4)-127.0.0.1] QueryResultImpl $logger retrieved ScoreNodes in 0 ms (0)
[snip]
Using this pattern:
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
So it seems that $logger is the logger name, isn't it?
-- Ceki http://twitter.com/#!/ceki _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

Thanks for your help, success at last! Using the following logback.xml <configuration> <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> <evaluator> <matcher> <Name>queries</Name> <regex>Performed query\.execute</regex> </matcher> <expression>queries.matches(formattedMessage)</expression> </evaluator> <OnMismatch>DENY</OnMismatch> <OnMatch>NEUTRAL</OnMatch> </filter> <encoder> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-40([%thread] [%level] %logger) %msg%n</pattern> </encoder> </appender> <logger name="org.apache.jackrabbit.core.session.SessionState" level="TRACE" /> <root level="WARN"> <appender-ref ref="console"/> </root> </configuration> Which is in jackrabbit-jca-2.4.1.jar inside jackrabbit-jca-2.4.1.rar Thanks again! Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes (56-2) 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl El 30-05-2012, a las 16:28, ceki escribió:
The pattern %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" does not match the output sent in your message. You probably have another config file lying around with $logger instead of %logger in the pattern.
On 30.05.2012 22:14, Gonzalo Vasquez wrote:
Strange, but I'll check as I'm getting the following kind of messages:
16:09:35,447 INFO [STDOUT] 2012-05-30 16:09:35.447 [RMI TCP Connection(4)-127.0.0.1] QueryResultImpl $logger retrieved ScoreNodes in 0 ms (0)
[snip]
Using this pattern:
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
So it seems that $logger is the logger name, isn't it?
-- Ceki http://twitter.com/#!/ceki _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
participants (2)
-
ceki
-
Gonzalo Vasquez