Pascal Leclercq (JIRA | 4 Oct 2010 11:09
Picon

[JIRA] Commented: (LBCORE-117) Supply an appender that collects N events on all levels and dumps them to the output when an ERROR is logged


    [
http://jira.qos.ch/browse/LBCORE-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11836#action_11836
] 

Pascal Leclercq commented on LBCORE-117:
----------------------------------------

I have exactly the same requirements. This feature will be extremly usefull I think. Is there any
workaround for the time being ?
I think smthg can be done using Evaluators and/or filters but I don't know where to find the last N logging event.

> Supply an appender that collects N events on all levels and dumps them to the output when an ERROR is logged
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: LBCORE-117
>                 URL: http://jira.qos.ch/browse/LBCORE-117
>             Project: logback-core
>          Issue Type: New Feature
>          Components: Appender
>            Reporter: Aaron Digulla
>            Assignee: Logback dev list
>
> For many applications, it's not necessary to log at the levels DEBUG and TRACE all the time. In fact, we
usually only do this to be able to debug ERROR events.
> It would be great if there was an appender that would only collect a configurable number of events
internally until a message of level ERROR or above is logged. At this time, the appender should dump it's
internal state to the log and reset the internal state.

--

-- 
(Continue reading)

Tobias Lund-Melcher | 5 Oct 2010 14:43
Picon

Missing logging of Throwable in SyslogAppender

Hi,

the project I'm working on decided to switch to slf4j and logback for logging, and our experiences so far are
very good. Thanks for the great work!!

During implementation and testing we discovered that the SyslogAppender does not seem to log the
throwable type and its message at all. To overcome this we've overridden the the
SyslogAppender.postProcess() method. I believe this is a bug which should be addressed. The git diff
after patching this is given below.

Best Regards,

Tobias Lund-Melcher

-----------------git diff-------------------------

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java b/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java
index 67845db..bc35399 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/net/SyslogAppender.java
 <at>  <at>  -21,6 +21,7  <at>  <at>  import ch.qos.logback.classic.pattern.SyslogStartConverter;
 import ch.qos.logback.classic.spi.ILoggingEvent;
 import ch.qos.logback.classic.spi.IThrowableProxy;
 import ch.qos.logback.classic.spi.StackTraceElementProxy;
+import ch.qos.logback.classic.spi.ThrowableProxyUtil;
 import ch.qos.logback.classic.util.LevelToSyslogSeverity;
 import ch.qos.logback.core.CoreConstants;
 import ch.qos.logback.core.Layout;
 <at>  <at>  -82,10 +83,15  <at>  <at>  public class SyslogAppender extends SyslogAppenderBase<ILoggingEvent> {

(Continue reading)

Ceki Gulcu (JIRA | 5 Oct 2010 19:36
Picon

[JIRA] Assigned: (LBCLASSIC-157) Add option to include caller data in JMS Appender or to disable caller data in DB Appender


     [
http://jira.qos.ch/browse/LBCLASSIC-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ceki Gulcu reassigned LBCLASSIC-157:
------------------------------------

    Assignee: Ceki Gulcu  (was: Logback dev list)

> Add option to include caller data in JMS Appender or to disable caller data in DB Appender
> ------------------------------------------------------------------------------------------
>
>                 Key: LBCLASSIC-157
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-157
>             Project: logback-classic
>          Issue Type: New Feature
>          Components: appender
>    Affects Versions: 0.917
>            Reporter: Ging Ming Chan
>            Assignee: Ceki Gulcu
>            Priority: Minor
>
> We are using the JMSQueueAppender remotely with a centralised server that uses the DBAppender to log to
the database.  However, since the JMSQueueAppender does not send the caller data, and the DBAppender
always expect it, the operation never succeeded.
> There are two options to fix this, either add the includeCallerData option in the JMS Appender or to
exclude caller data in the DB Appender.

--

-- 
This message is automatically generated by JIRA.
(Continue reading)

Picon

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.24-21-gd52ee5d

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  d52ee5dcef840f3083950b0374bc5b06f9dfae97 (commit)
      from  090b95566ecbae1a3321bed43b1d9c15dcac32e8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=d52ee5dcef840f3083950b0374bc5b06f9dfae97
http://github.com/ceki/logback/commit/d52ee5dcef840f3083950b0374bc5b06f9dfae97

commit d52ee5dcef840f3083950b0374bc5b06f9dfae97
Author: Ceki Gulcu <ceki@...>
Date:   Tue Oct 5 20:48:39 2010 +0200

    - typo fix

diff --git a/logback-site/src/site/pages/manual/appenders.html b/logback-site/src/site/pages/manual/appenders.html
index 0755721..3944286 100644
--- a/logback-site/src/site/pages/manual/appenders.html
+++ b/logback-site/src/site/pages/manual/appenders.html
 <at>  <at>  -2669,14 +2669,14  <at>  <at>  logger.error(<b>notifyAdminMarker</b>,
     MDCDiscriminator</a></h3>

     <p>As mentioned earlier, by specifiying a discriminator other than
(Continue reading)

Paulo R P Andrade (JIRA | 5 Oct 2010 22:38
Picon

[JIRA] Updated: (LBCORE-169) RollingFileAppender/TimeBasedRollingPolicy failing to ZIP files in different directory


     [
http://jira.qos.ch/browse/LBCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paulo R P Andrade updated LBCORE-169:
-------------------------------------

    Attachment: LBCORE-169_patch.txt

> RollingFileAppender/TimeBasedRollingPolicy failing to ZIP files in different directory
> --------------------------------------------------------------------------------------
>
>                 Key: LBCORE-169
>                 URL: http://jira.qos.ch/browse/LBCORE-169
>             Project: logback-core
>          Issue Type: Bug
>          Components: Rolling
>    Affects Versions: 0.9.24
>            Reporter: Tomasz Nurkiewicz
>            Assignee: Logback dev list
>         Attachments: LBCORE-169.zip, LBCORE-169_patch.txt
>
>
> When using ZIP feature to compress old log files, Logback does not allow to put ZIP files in different
directory like in this example:
> <file>logs\server.log</file>
> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>   <fileNamePattern>logs\arch\server.%d{yyyy-MM-dd_HHmm}.log.zip</fileNamePattern>
> </rollingPolicy>
> Running the attached test maven project (it takes 1 minute to run) will create
(Continue reading)

Paulo R P Andrade (JIRA | 5 Oct 2010 22:38
Picon

[JIRA] Commented: (LBCORE-169) RollingFileAppender/TimeBasedRollingPolicy failing to ZIP files in different directory


    [
http://jira.qos.ch/browse/LBCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11837#action_11837
] 

Paulo R P Andrade commented on LBCORE-169:
------------------------------------------

I was able to setup the fileNamePattern using the timestamp tag as showed bellow:

<file>logs\server.log</file> 
<timestamp key="byMonth" datePattern="yyyyMM"/>-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 
  <fileNamePattern>logs\arch-${byMonth}\server.%d{yyyy-MM-dd_HHmm}.log.zip</fileNamePattern> 
</rollingPolicy> 

But if the directory(${byMonth}) doesn't exist, the compression fails with a
java.io.FileNotFoundException error. Apparently the fix for LBCORE-151 doesn't work for compressed files.

I'm attaching a patch(LBCORE-160_patch.txt) to fix the compression of files in directories that doesn't
exist yet. My original patch was to call renameUtil.createMissingTargetDirsIfNecessary from
helper.Compressor class, but at that point I don't know how to set the context for the RenameUtil. Anyway,
attached goes an initial idea where you guys can start with.

> RollingFileAppender/TimeBasedRollingPolicy failing to ZIP files in different directory
> --------------------------------------------------------------------------------------
>
>                 Key: LBCORE-169
>                 URL: http://jira.qos.ch/browse/LBCORE-169
>             Project: logback-core
(Continue reading)

Picon

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.24-22-g909a8e4

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  909a8e44a8b766582624b62a32631ca348c70d49 (commit)
      from  d52ee5dcef840f3083950b0374bc5b06f9dfae97 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=909a8e44a8b766582624b62a32631ca348c70d49
http://github.com/ceki/logback/commit/909a8e44a8b766582624b62a32631ca348c70d49

commit 909a8e44a8b766582624b62a32631ca348c70d49
Author: Ceki Gulcu <ceki@...>
Date:   Fri Oct 8 18:37:19 2010 +0200

    - fixes

diff --git
a/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/GafferConfigurator.groovy b/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/GafferConfigurator.groovy
index 9635eda..3d7811c 100644
--- a/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/GafferConfigurator.groovy
+++ b/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/GafferConfigurator.groovy
 <at>  <at>  -21,7 +21,7  <at>  <at>  class GafferConfigurator {

   LoggerContext context
(Continue reading)

Picon

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.24-23-gf25fb2e

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  f25fb2e781923f5569795de6828cebb911c9451b (commit)
      from  909a8e44a8b766582624b62a32631ca348c70d49 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=f25fb2e781923f5569795de6828cebb911c9451b
http://github.com/ceki/logback/commit/f25fb2e781923f5569795de6828cebb911c9451b

commit f25fb2e781923f5569795de6828cebb911c9451b
Author: Ceki Gulcu <ceki@...>
Date:   Mon Oct 11 17:40:44 2010 +0200

    typo fix

diff --git a/logback-site/src/site/pages/manual/configuration.html b/logback-site/src/site/pages/manual/configuration.html
index 9782baf..2d0db3e 100644
--- a/logback-site/src/site/pages/manual/configuration.html
+++ b/logback-site/src/site/pages/manual/configuration.html
 <at>  <at>  -242,7 +242,7  <at>  <at>  public class Foo {

    <p class="example">Example: Basic configuration file
    (logback-examples/src/main/java/chapters/configuration/sample0.xml)</p>
(Continue reading)

Juan M Uys | 11 Oct 2010 21:45
Picon
Gravatar

redis appender

_______________________________________________
logback-dev mailing list
logback-dev@...
http://qos.ch/mailman/listinfo/logback-dev
Picon

[GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.24-25-gb8b8a86

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  b8b8a86ea7fb2a8a35751ebbdc0929633c784303 (commit)
       via  c3c5476f1d20eca1a7d5681a1854a567880ee4d3 (commit)
      from  f25fb2e781923f5569795de6828cebb911c9451b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=b8b8a86ea7fb2a8a35751ebbdc0929633c784303
http://github.com/ceki/logback/commit/b8b8a86ea7fb2a8a35751ebbdc0929633c784303

commit b8b8a86ea7fb2a8a35751ebbdc0929633c784303
Merge: c3c5476 f25fb2e
Author: Ceki Gulcu <ceki@...>
Date:   Tue Oct 12 22:22:52 2010 +0200

    Merge branch 'master' of git.qos.ch:logback

http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=c3c5476f1d20eca1a7d5681a1854a567880ee4d3
http://github.com/ceki/logback/commit/c3c5476f1d20eca1a7d5681a1854a567880ee4d3

commit c3c5476f1d20eca1a7d5681a1854a567880ee4d3
Author: Ceki Gulcu <ceki@...>
Date:   Tue Oct 12 22:22:10 2010 +0200

    - adding the capability to listen to level changes

diff --git
a/logback-classic/src/main/java/ch/qos/logback/classic/joran/action/LoggerContextListenerAction.java b/logback-classic/src/main/java/ch/qos/logback/classic/joran/action/LoggerContextListenerAction.java
new file mode 100644
index 0000000..fe6890e
--- /dev/null
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/joran/action/LoggerContextListenerAction.java
 <at>  <at>  -0,0 +1,80  <at>  <at> 
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ * Copyright (C) 1999-2009, QOS.ch. All rights reserved.
+ *
+ * This program and the accompanying materials are dual-licensed under
+ * either the terms of the Eclipse Public License v1.0 as published by
+ * the Eclipse Foundation
+ *
+ *   or (per the licensee's choosing)
+ *
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ */
+package ch.qos.logback.classic.joran.action;
+
+import java.lang.management.ManagementFactory;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import ch.qos.logback.classic.spi.LoggerContextListener;
+import ch.qos.logback.core.boolex.EventEvaluator;
+import ch.qos.logback.core.spi.LifeCycle;
+import org.xml.sax.Attributes;
+
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.jmx.JMXConfigurator;
+import ch.qos.logback.classic.jmx.MBeanUtil;
+import ch.qos.logback.core.joran.action.Action;
+import ch.qos.logback.core.joran.spi.ActionException;
+import ch.qos.logback.core.joran.spi.InterpretationContext;
+import ch.qos.logback.core.util.OptionHelper;
+
+public class LoggerContextListenerAction extends Action {
+  boolean inError = false;
+  LoggerContextListener lcl;
+
+   <at> Override
+  public void begin(InterpretationContext ec, String name, Attributes attributes)
+          throws ActionException {
+
+    inError = false;
+
+    String className = attributes.getValue(CLASS_ATTRIBUTE);
+    if (OptionHelper.isEmpty(className)) {
+      addError("Mandatory \"" + CLASS_ATTRIBUTE
+              + "\" attribute not set for <loggerContextListener> element");
+      inError = true;
+      return;
+    }
+
+    try {
+      lcl = (LoggerContextListener) OptionHelper.instantiateByClassName(
+              className, LoggerContextListener.class, context);
+
+      ec.pushObject(lcl);
+      addInfo("Adding LoggerContextListener of type [" + className
+              + "] to the object stack");
+
+    } catch (Exception oops) {
+      inError = true;
+      addError("Could not create LoggerContextListener of type " + className + "].", oops);
+    }
+  }
+
+   <at> Override
+  public void end(InterpretationContext ec, String name) throws ActionException {
+    if (inError) {
+      return;
+    }
+    Object o = ec.peekObject();
+
+    if (o != lcl) {
+      addWarn("The object on the top the of the stack is not the LoggerContextListener pushed earlier.");
+    } else {
+      ec.popObject();
+    }
+  }
+
+}

-----------------------------------------------------------------------

Summary of changes:
 .../joran/action/LoggerContextListenerAction.java  |   80 ++++++++++++++++++++
 1 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 logback-classic/src/main/java/ch/qos/logback/classic/joran/action/LoggerContextListenerAction.java

hooks/post-receive
--

-- 
Logback: the generic, reliable, fast and flexible logging framework.

Gmane