Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Use OnlyOnceErrorManager to prevent deadlocks while reporting errors #57
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Dec 17, 2015
1 parent c182142 commit 5c64bdb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import biz.paluch.logging.gelf.StaticMessageField;
import biz.paluch.logging.gelf.intern.GelfMessage;
import org.jboss.logmanager.ExtLogRecord;
import org.jboss.logmanager.errormanager.OnlyOnceErrorManager;

import java.util.logging.ErrorManager;
import java.util.logging.LogRecord;

/**
Expand Down Expand Up @@ -63,8 +65,10 @@
*/
public class JBoss7GelfLogHandler extends biz.paluch.logging.gelf.jul.GelfLogHandler {

private static final ErrorManager DEFAULT_ERROR_MANAGER = new OnlyOnceErrorManager();
public JBoss7GelfLogHandler() {
super();
super.setErrorManager(DEFAULT_ERROR_MANAGER);
}

protected void initializeDefaultFields() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static biz.paluch.logging.gelf.LogMessageField.NamedLogField.*;

import java.util.logging.ErrorManager;
import java.util.logging.LogRecord;

import org.jboss.logmanager.ExtLogRecord;
Expand All @@ -10,6 +11,7 @@
import biz.paluch.logging.gelf.intern.GelfMessage;
import biz.paluch.logging.gelf.jboss7.JBoss7JulLogEvent;
import biz.paluch.logging.gelf.jul.GelfLogHandler;
import org.jboss.logmanager.errormanager.OnlyOnceErrorManager;

/**
* Logging-Handler for GELF (Graylog Extended Logging Format). This Java-Util-Logging Handler creates GELF Messages and posts
Expand Down Expand Up @@ -55,8 +57,10 @@
*
*/
public class WildFlyGelfLogHandler extends GelfLogHandler {
private static final ErrorManager DEFAULT_ERROR_MANAGER = new OnlyOnceErrorManager();
public WildFlyGelfLogHandler() {
super();
super.setErrorManager(DEFAULT_ERROR_MANAGER);
}

protected void initializeDefaultFields() {
Expand Down

0 comments on commit 5c64bdb

Please sign in to comment.