Wildfly raven sentry logging

433 views
Skip to first unread message

jim

unread,
Oct 7, 2014, 1:39:56 AM10/7/14
to gets...@googlegroups.com
Hi,

I want to log the errors to sentry server from a wildfly application. I am using java.util.logging in my project.

I tried adding a custom-handler as mentioned in here. Added raven jar as a global module to wildfly subsystem. But still nothing is logged to sentry. Unfortunately, I am not getting any exceptions to indicate something is wrong. Logs are shown in console and server.log but not in sentry.

I could not find proper configuration notes on this topic. Please help me.

Thanks in advance.

David Cramer

unread,
Oct 8, 2014, 2:11:02 AM10/8/14
to gets...@googlegroups.com
I’m not super familiar with Java, but just to confirm have you followed the instructions here:

--
You received this message because you are subscribed to the Google Groups "sentry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getsentry+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jim

unread,
Oct 11, 2014, 12:59:47 AM10/11/14
to gets...@googlegroups.com
Hi David,

Thanks a lot for the response. Yes, I have tried these but no luck. Wildfly logging is bit different I guess. Need to figure it out.

David Cramer (zeeg)

unread,
Oct 11, 2014, 2:44:07 AM10/11/14
to gets...@googlegroups.com
Definitely keep us posted. It's hard to keep up with all the integrations but I'm sure others will find it useful


Jim

unread,
May 26, 2015, 5:50:50 AM5/26/15
to gets...@googlegroups.com
Hi David,

I could not find a proper solution for this. I use java.util.logging in the wildfly application.

1. Added the maven dependency to the project
2. Added logging.properties in the jboss logging.properties format. At first, I tried with the logging.properties entries exactly as given in here but wildfly failed to read that config. Then I tried the below one.

---
logger.level=WARN
logger.handlers=SENTRY
handler.SENTRY=net.kencochrane.raven.jul.SentryHandler
handler.SENTRY.properties=net.kencochrane.raven.jul.SentryHandler.dsn, net.kencochrane.raven.jul.SentryHandler.tags
handler.SENTRY.net.kencochrane.raven.jul.SentryHandler.dsn=https://publicKey:secretKey@host:port/1?options
handler.SENTRY.net.kencochrane.raven.jul.SentryHandler.tags=tag1:value1,tag2:value2
---

3. Added raven jar as a wildfly module.

Now, I get the below error when application is deployed

---
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011555: Failed to configure logging using 'logging.properties' configuration file.
    Caused by: java.lang.IllegalArgumentException: No property \"net.kencochrane.raven.jul.SentryHandler.dsn\" setter found for handler \"SENTRY\""}}
---

I could see that there is no associated setter method for net.kencochrane.raven.jul.SentryHandler.dsn in the SentryHandler class. I tried adding a setter method for this which I could locate in raven-logback project. Then the error disappeared and I could see that dsn variable in SentryHandler class is a null value when wildfly starts up. This means dsn value is never properly read by LogManager. Please help me to find a solution. 

Thanks in advance.

David Cramer

unread,
May 27, 2015, 6:32:45 AM5/27/15
to gets...@googlegroups.com, gets...@googlegroups.com
Is it possible its not finding the library? I haven’t really used Java in a long time (and never used the logging libraries) so I’m not the best person to provide advice here.

You may also consider opening a ticket about the lack of setter. That could indicate a problem with the code or simply that it’s not reading it correctly.
Reply all
Reply to author
Forward
0 new messages