How to integrate Java Wildfly Swarm applications with Sentry?









up vote
0
down vote

favorite












We have a Java Wildfly Swarm application and I'm trying to configure it to report Sentry events.



Referenced versions:




  • Wildfly BOM: org.wildfly.bom:wildfly-javaee7:10.1.0.Final


  • Swarm Plugin: org.wildfly.swarm:wildfly-swarm-plugin:2017.12.1

I added the following configurations:



<!-- pom.xml -->
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.7.13</version>
</dependency>

# project-defautls.yml
swarm:
logging:
pattern-formatters:
LOG_FORMATTER:
pattern: "%dyyyy-MM-dd HH:mm:ss,SSS %-5p (%t) [%c.%M()] %s%e%n"
console-handlers:
CONSOLE:
named-formatter: LOG_FORMATTER
level: INFO
custom-handlers:
SENTRY:
module: com.sentry.jul
attribute-class: io.sentry.jul.SentryHandler
named-formatter: LOG_FORMATTER
level: INFO
root-logger:
handlers:
- CONSOLE
- SENTRY

<!-- module.xml -->
<module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
<resources>
<artifact name="io.sentry:sentry:1.7.13" />
</resources>
</module>

# Environment variable
SENTRY_DSN=***********


The application starts normally, but the following code snippet is not generating Sentry events:



try 
throw new Exception("Testing...");
catch(Exception e)
logger.log(Level.SEVERE, "ERROR 0", e.getMessage());



By other hand, it works fine when I configure Sentry by code and generate an event:



Sentry.init(System.getenv("SENTRY_DSN"));
SentryClient sentry = SentryClientFactory.sentryClient();
try
throw new Exception("Testing...");
catch(Exception e)
sentry.sendException(e);



What is going wrong?










share|improve this question























  • If you log at DEBUG level (not to Sentry but to your normal logger) does it say anything initializing Sentry, or about an appender not being located?
    – Brett
    Nov 6 at 1:07










  • I wonder where does the com.sentry.jul module come from. The io.sentry:sentry:1.7.13 artifact certainly doesn't ship a module.xml.
    – Ladicek
    Nov 6 at 8:49










  • I added com.sentry.jul as a jboss module in src/main/resources. If we don't provide a module, then application startup fails. I'm going to update this question to make it clear.
    – Fernando Costa
    Nov 6 at 9:19











  • No log debugging message is shown
    – Fernando Costa
    Nov 6 at 17:12










  • I'm trying to debug the code of io.sentry.jul.SentryHandler inside my Eclipse IDE to see what is going on. I set four breakpoints in the publish method at lines 98, 99, 105 and 107. The debugger reaches only the first one. It is weird.
    – Fernando Costa
    Nov 8 at 3:21














up vote
0
down vote

favorite












We have a Java Wildfly Swarm application and I'm trying to configure it to report Sentry events.



Referenced versions:




  • Wildfly BOM: org.wildfly.bom:wildfly-javaee7:10.1.0.Final


  • Swarm Plugin: org.wildfly.swarm:wildfly-swarm-plugin:2017.12.1

I added the following configurations:



<!-- pom.xml -->
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.7.13</version>
</dependency>

# project-defautls.yml
swarm:
logging:
pattern-formatters:
LOG_FORMATTER:
pattern: "%dyyyy-MM-dd HH:mm:ss,SSS %-5p (%t) [%c.%M()] %s%e%n"
console-handlers:
CONSOLE:
named-formatter: LOG_FORMATTER
level: INFO
custom-handlers:
SENTRY:
module: com.sentry.jul
attribute-class: io.sentry.jul.SentryHandler
named-formatter: LOG_FORMATTER
level: INFO
root-logger:
handlers:
- CONSOLE
- SENTRY

<!-- module.xml -->
<module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
<resources>
<artifact name="io.sentry:sentry:1.7.13" />
</resources>
</module>

# Environment variable
SENTRY_DSN=***********


The application starts normally, but the following code snippet is not generating Sentry events:



try 
throw new Exception("Testing...");
catch(Exception e)
logger.log(Level.SEVERE, "ERROR 0", e.getMessage());



By other hand, it works fine when I configure Sentry by code and generate an event:



Sentry.init(System.getenv("SENTRY_DSN"));
SentryClient sentry = SentryClientFactory.sentryClient();
try
throw new Exception("Testing...");
catch(Exception e)
sentry.sendException(e);



What is going wrong?










share|improve this question























  • If you log at DEBUG level (not to Sentry but to your normal logger) does it say anything initializing Sentry, or about an appender not being located?
    – Brett
    Nov 6 at 1:07










  • I wonder where does the com.sentry.jul module come from. The io.sentry:sentry:1.7.13 artifact certainly doesn't ship a module.xml.
    – Ladicek
    Nov 6 at 8:49










  • I added com.sentry.jul as a jboss module in src/main/resources. If we don't provide a module, then application startup fails. I'm going to update this question to make it clear.
    – Fernando Costa
    Nov 6 at 9:19











  • No log debugging message is shown
    – Fernando Costa
    Nov 6 at 17:12










  • I'm trying to debug the code of io.sentry.jul.SentryHandler inside my Eclipse IDE to see what is going on. I set four breakpoints in the publish method at lines 98, 99, 105 and 107. The debugger reaches only the first one. It is weird.
    – Fernando Costa
    Nov 8 at 3:21












up vote
0
down vote

favorite









up vote
0
down vote

favorite











We have a Java Wildfly Swarm application and I'm trying to configure it to report Sentry events.



Referenced versions:




  • Wildfly BOM: org.wildfly.bom:wildfly-javaee7:10.1.0.Final


  • Swarm Plugin: org.wildfly.swarm:wildfly-swarm-plugin:2017.12.1

I added the following configurations:



<!-- pom.xml -->
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.7.13</version>
</dependency>

# project-defautls.yml
swarm:
logging:
pattern-formatters:
LOG_FORMATTER:
pattern: "%dyyyy-MM-dd HH:mm:ss,SSS %-5p (%t) [%c.%M()] %s%e%n"
console-handlers:
CONSOLE:
named-formatter: LOG_FORMATTER
level: INFO
custom-handlers:
SENTRY:
module: com.sentry.jul
attribute-class: io.sentry.jul.SentryHandler
named-formatter: LOG_FORMATTER
level: INFO
root-logger:
handlers:
- CONSOLE
- SENTRY

<!-- module.xml -->
<module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
<resources>
<artifact name="io.sentry:sentry:1.7.13" />
</resources>
</module>

# Environment variable
SENTRY_DSN=***********


The application starts normally, but the following code snippet is not generating Sentry events:



try 
throw new Exception("Testing...");
catch(Exception e)
logger.log(Level.SEVERE, "ERROR 0", e.getMessage());



By other hand, it works fine when I configure Sentry by code and generate an event:



Sentry.init(System.getenv("SENTRY_DSN"));
SentryClient sentry = SentryClientFactory.sentryClient();
try
throw new Exception("Testing...");
catch(Exception e)
sentry.sendException(e);



What is going wrong?










share|improve this question















We have a Java Wildfly Swarm application and I'm trying to configure it to report Sentry events.



Referenced versions:




  • Wildfly BOM: org.wildfly.bom:wildfly-javaee7:10.1.0.Final


  • Swarm Plugin: org.wildfly.swarm:wildfly-swarm-plugin:2017.12.1

I added the following configurations:



<!-- pom.xml -->
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.7.13</version>
</dependency>

# project-defautls.yml
swarm:
logging:
pattern-formatters:
LOG_FORMATTER:
pattern: "%dyyyy-MM-dd HH:mm:ss,SSS %-5p (%t) [%c.%M()] %s%e%n"
console-handlers:
CONSOLE:
named-formatter: LOG_FORMATTER
level: INFO
custom-handlers:
SENTRY:
module: com.sentry.jul
attribute-class: io.sentry.jul.SentryHandler
named-formatter: LOG_FORMATTER
level: INFO
root-logger:
handlers:
- CONSOLE
- SENTRY

<!-- module.xml -->
<module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
<resources>
<artifact name="io.sentry:sentry:1.7.13" />
</resources>
</module>

# Environment variable
SENTRY_DSN=***********


The application starts normally, but the following code snippet is not generating Sentry events:



try 
throw new Exception("Testing...");
catch(Exception e)
logger.log(Level.SEVERE, "ERROR 0", e.getMessage());



By other hand, it works fine when I configure Sentry by code and generate an event:



Sentry.init(System.getenv("SENTRY_DSN"));
SentryClient sentry = SentryClientFactory.sentryClient();
try
throw new Exception("Testing...");
catch(Exception e)
sentry.sendException(e);



What is going wrong?







java sentry wildfly-swarm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 19:11

























asked Nov 5 at 21:17









Fernando Costa

347315




347315











  • If you log at DEBUG level (not to Sentry but to your normal logger) does it say anything initializing Sentry, or about an appender not being located?
    – Brett
    Nov 6 at 1:07










  • I wonder where does the com.sentry.jul module come from. The io.sentry:sentry:1.7.13 artifact certainly doesn't ship a module.xml.
    – Ladicek
    Nov 6 at 8:49










  • I added com.sentry.jul as a jboss module in src/main/resources. If we don't provide a module, then application startup fails. I'm going to update this question to make it clear.
    – Fernando Costa
    Nov 6 at 9:19











  • No log debugging message is shown
    – Fernando Costa
    Nov 6 at 17:12










  • I'm trying to debug the code of io.sentry.jul.SentryHandler inside my Eclipse IDE to see what is going on. I set four breakpoints in the publish method at lines 98, 99, 105 and 107. The debugger reaches only the first one. It is weird.
    – Fernando Costa
    Nov 8 at 3:21
















  • If you log at DEBUG level (not to Sentry but to your normal logger) does it say anything initializing Sentry, or about an appender not being located?
    – Brett
    Nov 6 at 1:07










  • I wonder where does the com.sentry.jul module come from. The io.sentry:sentry:1.7.13 artifact certainly doesn't ship a module.xml.
    – Ladicek
    Nov 6 at 8:49










  • I added com.sentry.jul as a jboss module in src/main/resources. If we don't provide a module, then application startup fails. I'm going to update this question to make it clear.
    – Fernando Costa
    Nov 6 at 9:19











  • No log debugging message is shown
    – Fernando Costa
    Nov 6 at 17:12










  • I'm trying to debug the code of io.sentry.jul.SentryHandler inside my Eclipse IDE to see what is going on. I set four breakpoints in the publish method at lines 98, 99, 105 and 107. The debugger reaches only the first one. It is weird.
    – Fernando Costa
    Nov 8 at 3:21















If you log at DEBUG level (not to Sentry but to your normal logger) does it say anything initializing Sentry, or about an appender not being located?
– Brett
Nov 6 at 1:07




If you log at DEBUG level (not to Sentry but to your normal logger) does it say anything initializing Sentry, or about an appender not being located?
– Brett
Nov 6 at 1:07












I wonder where does the com.sentry.jul module come from. The io.sentry:sentry:1.7.13 artifact certainly doesn't ship a module.xml.
– Ladicek
Nov 6 at 8:49




I wonder where does the com.sentry.jul module come from. The io.sentry:sentry:1.7.13 artifact certainly doesn't ship a module.xml.
– Ladicek
Nov 6 at 8:49












I added com.sentry.jul as a jboss module in src/main/resources. If we don't provide a module, then application startup fails. I'm going to update this question to make it clear.
– Fernando Costa
Nov 6 at 9:19





I added com.sentry.jul as a jboss module in src/main/resources. If we don't provide a module, then application startup fails. I'm going to update this question to make it clear.
– Fernando Costa
Nov 6 at 9:19













No log debugging message is shown
– Fernando Costa
Nov 6 at 17:12




No log debugging message is shown
– Fernando Costa
Nov 6 at 17:12












I'm trying to debug the code of io.sentry.jul.SentryHandler inside my Eclipse IDE to see what is going on. I set four breakpoints in the publish method at lines 98, 99, 105 and 107. The debugger reaches only the first one. It is weird.
– Fernando Costa
Nov 8 at 3:21




I'm trying to debug the code of io.sentry.jul.SentryHandler inside my Eclipse IDE to see what is going on. I set four breakpoints in the publish method at lines 98, 99, 105 and 107. The debugger reaches only the first one. It is weird.
– Fernando Costa
Nov 8 at 3:21












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










After debugging the code I realized my module definition was incomplete. I had to add other artifacts and dependencies:



<module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
<resources>
<artifact name="io.sentry:sentry:1.7.13" />
<artifact name="com.fasterxml.jackson.core:jackson-core:2.8.7" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.servlet.api" />
<module name="org.slf4j"/>
</dependencies>
</module>


Also I noticed there is no need to keep a project dependency to Sentry.



That's all!






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53162360%2fhow-to-integrate-java-wildfly-swarm-applications-with-sentry%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    After debugging the code I realized my module definition was incomplete. I had to add other artifacts and dependencies:



    <module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
    <resources>
    <artifact name="io.sentry:sentry:1.7.13" />
    <artifact name="com.fasterxml.jackson.core:jackson-core:2.8.7" />
    </resources>
    <dependencies>
    <module name="javax.api" />
    <module name="javax.servlet.api" />
    <module name="org.slf4j"/>
    </dependencies>
    </module>


    Also I noticed there is no need to keep a project dependency to Sentry.



    That's all!






    share|improve this answer


























      up vote
      0
      down vote



      accepted










      After debugging the code I realized my module definition was incomplete. I had to add other artifacts and dependencies:



      <module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
      <resources>
      <artifact name="io.sentry:sentry:1.7.13" />
      <artifact name="com.fasterxml.jackson.core:jackson-core:2.8.7" />
      </resources>
      <dependencies>
      <module name="javax.api" />
      <module name="javax.servlet.api" />
      <module name="org.slf4j"/>
      </dependencies>
      </module>


      Also I noticed there is no need to keep a project dependency to Sentry.



      That's all!






      share|improve this answer
























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        After debugging the code I realized my module definition was incomplete. I had to add other artifacts and dependencies:



        <module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
        <resources>
        <artifact name="io.sentry:sentry:1.7.13" />
        <artifact name="com.fasterxml.jackson.core:jackson-core:2.8.7" />
        </resources>
        <dependencies>
        <module name="javax.api" />
        <module name="javax.servlet.api" />
        <module name="org.slf4j"/>
        </dependencies>
        </module>


        Also I noticed there is no need to keep a project dependency to Sentry.



        That's all!






        share|improve this answer














        After debugging the code I realized my module definition was incomplete. I had to add other artifacts and dependencies:



        <module xmlns="urn:jboss:module:1.3" name="com.sentry.jul">
        <resources>
        <artifact name="io.sentry:sentry:1.7.13" />
        <artifact name="com.fasterxml.jackson.core:jackson-core:2.8.7" />
        </resources>
        <dependencies>
        <module name="javax.api" />
        <module name="javax.servlet.api" />
        <module name="org.slf4j"/>
        </dependencies>
        </module>


        Also I noticed there is no need to keep a project dependency to Sentry.



        That's all!







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 9 at 18:50

























        answered Nov 9 at 15:47









        Fernando Costa

        347315




        347315



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53162360%2fhow-to-integrate-java-wildfly-swarm-applications-with-sentry%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Darth Vader #20

            Ondo