<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use third-party log4j appenders in Nuxeo Tomcat distribution? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328398#M15399</link>
    <description>&lt;P&gt;Would you mind contribute or document a Raven Log4J configuration template? Regards.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2013 04:43:39 GMT</pubDate>
    <dc:creator>Julien_Carsique</dc:creator>
    <dc:date>2013-06-13T04:43:39Z</dc:date>
    <item>
      <title>How to use third-party log4j appenders in Nuxeo Tomcat distribution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328395#M15396</link>
      <description>&lt;P&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;: At &lt;A href="http://answers.nuxeo.com/users/12/julien-carsique/"&gt;Julien Carsique&lt;/A&gt;'s request I'll explain what I did to get Sentry logging working. We use Puppet for creating configuration files rather than Nuxeo templates, but the edits are so straightforward that it doesn't matter how it's done.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Deploy a &lt;A href="https://getsentry.com/welcome/"&gt;Sentry&lt;/A&gt; server and acquire the DSN for your Nuxeo system to access it.&lt;/LI&gt;
&lt;LI&gt;Download the &lt;A href="https://github.com/kencochrane/raven-java/blob/master/INSTALL.md"&gt;raven-java&lt;/A&gt; jars and dependencies. I simply made a dummy Maven project and relied on dependency:copy-dependencies to acquire them. The jars should include raven-x.0.jar, raven-log4j-x.0.jar, jackson-core-2.2.0.jar, commons-codec-1.8.jar, slf4j-api-1.7.5.jar, and slf4j-log4j12-1.7.5.jar. You must match the Raven version (3.0 or 4.0) with the protocol used by your Sentry server.&lt;/LI&gt;
&lt;LI&gt;Copy these jars into NUXEO_HOME/server/lib (the Tomcat lib directory).&lt;/LI&gt;
&lt;LI&gt;Add code like the following to log4j.xml, which should be in the same directory:&lt;/LI&gt;
&lt;/OL&gt;
&lt;!--language: lang-xml --&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;appender name="SENTRY" class="net.kencochrane.raven.log4j.SentryAppender"&amp;gt;
  &amp;lt;param name="dsn" value="https://this-is-your-sentry-dsn-value-paste-it-in-exactly:1234/3"/&amp;gt;
  &amp;lt;filter class="org.apache.log4j.varia.LevelRangeFilter"&amp;gt;
    &amp;lt;param name="levelMin" value="WARN"/&amp;gt;
  &amp;lt;/filter&amp;gt;
&amp;lt;/appender&amp;gt;
&amp;lt;root&amp;gt;
   &amp;lt;level value="WARN" /&amp;gt;
   &amp;lt;appender-ref ref="CONSOLE" /&amp;gt;
   &amp;lt;appender-ref ref="FILE" /&amp;gt;
   &amp;lt;appender-ref ref="SENTRY" /&amp;gt;
&amp;lt;/root&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My trouble below was caused by an invalid DSN -- it didn't even resolve in DNS.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ORIGINAL QUESTION&lt;/STRONG&gt; (fixed it myself):&lt;/P&gt;
&lt;P&gt;I would like to use the &lt;A href="https://github.com/kencochrane/raven-java"&gt;raven-java&lt;/A&gt; Log4J appender to log notable events to a Sentry event console. I tried the simplest thing which could possibly work, which is to deploy the raven jars and their dependencies into Nuxeo's &lt;CODE&gt;server/lib&lt;/CODE&gt; directory, and edit the &lt;CODE&gt;log4j.xml&lt;/CODE&gt; to add a new appender. I receive the following error on startup:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;2013-06-12 20:37:41,062 ERROR [org.nuxeo.runtime.tomcat.NuxeoLauncher] Failed to handle event
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.nuxeo.osgi.application.FrameworkBootstrap.start(FrameworkBootstrap.java:135)
        at org.nuxeo.runtime.tomcat.NuxeoLauncher.handleEvent(NuxeoLauncher.java:117)
        at org.nuxeo.runtime.tomcat.NuxeoLauncher.lifecycleEvent(NuxeoLauncher.java:88)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4700)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
        at org.apache.catalina.core.StandardService.start(StandardService.java:525)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.NullPointerException
        at net.kencochrane.raven.log4j.SentryAppender.buildEvent(SentryAppender.java:125)
        at net.kencochrane.raven.log4j.SentryAppender.append(SentryAppender.java:89)
        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at org.apache.log4j.Category.forcedLog(Category.java:391)
        at org.apache.log4j.Category.log(Category.java:856)
        at org.apache.commons.logging.impl.Log4JLogger.info(Log4JLogger.java:193)
        at org.nuxeo.osgi.application.loader.FrameworkLoader.printStartMessage(FrameworkLoader.java:379)
        at org.nuxeo.osgi.application.loader.FrameworkLoader.doStart(FrameworkLoader.java:204)
        at org.nuxeo.osgi.application.loader.FrameworkLoader.start(FrameworkLoader.java:112)
        ... 31 more
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This error is interesting because it seems to indicate that the new classes and configurations are available, but that something in the way Nuxeo starts within Tomcat makes the state of the Raven logging system invalid.&lt;/P&gt;
&lt;P&gt;Is there something general I am missing about using third-party log4j appenders with Nuxeo/Tomcat, or is this problem specific to Raven?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 22:48:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328395#M15396</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2013-06-12T22:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use third-party log4j appenders in Nuxeo Tomcat distribution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328396#M15397</link>
      <description>&lt;P&gt;In order to answer my own question, this was caused by incorrect configuration of the Raven appender. This error apparently occurred before the appender of server.log was initialized. I wonder how to detect this class of error in general, since there was no indication of anything wrong in any of the Nuxeo-documented logs.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 23:09:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328396#M15397</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2013-06-12T23:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use third-party log4j appenders in Nuxeo Tomcat distribution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328397#M15398</link>
      <description>&lt;P&gt;You mean there were unlogged errors? Maybe starting the server in &lt;CODE&gt;console&lt;/CODE&gt; would show them? Did you look into the other log files?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 04:40:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328397#M15398</guid>
      <dc:creator>Julien_Carsique</dc:creator>
      <dc:date>2013-06-13T04:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use third-party log4j appenders in Nuxeo Tomcat distribution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328398#M15399</link>
      <description>&lt;P&gt;Would you mind contribute or document a Raven Log4J configuration template? Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 04:43:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328398#M15399</guid>
      <dc:creator>Julien_Carsique</dc:creator>
      <dc:date>2013-06-13T04:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use third-party log4j appenders in Nuxeo Tomcat distribution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328399#M15400</link>
      <description>&lt;P&gt;I looked in all the log files and didn't see anything. I assume that the error message complains about a bad initialization value in log4j.xml for the Sentry appender.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 15:35:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328399#M15400</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2013-06-13T15:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use third-party log4j appenders in Nuxeo Tomcat distribution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328400#M15401</link>
      <description>&lt;P&gt;Strange you don't get an error, I'll try to reproduce it.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 17:42:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328400#M15401</guid>
      <dc:creator>Julien_Carsique</dc:creator>
      <dc:date>2013-06-13T17:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use third-party log4j appenders in Nuxeo Tomcat distribution?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328401#M15402</link>
      <description>&lt;P&gt;I added step-by-step instructions to the question above for now.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 22:06:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-use-third-party-log4j-appenders-in-nuxeo-tomcat/m-p/328401#M15402</guid>
      <dc:creator>Steven_Huwig1</dc:creator>
      <dc:date>2013-06-13T22:06:55Z</dc:date>
    </item>
  </channel>
</rss>

