forked from corda/corda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request corda#2758 from corda/merge/CORDA-1155
CORDA-1155 - Jolokia logging via slf4j (corda#2753)
- Loading branch information
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
node/src/main/kotlin/net/corda/node/JolokiaSlf4jAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package net.corda.node | ||
|
||
import org.jolokia.util.LogHandler | ||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
|
||
class JolokiaSlf4jAdapter : LogHandler { | ||
companion object { | ||
val log: Logger = LoggerFactory.getLogger("org.jolokia") | ||
} | ||
|
||
override fun error(message: String?, t: Throwable?) { | ||
if (message != null) { | ||
if (t != null) { | ||
log.error(message, t) | ||
} else { | ||
log.error(message) | ||
} | ||
} else if (t != null) { | ||
log.error("Exception without a comment", t) | ||
} | ||
} | ||
|
||
override fun debug(message: String?) { | ||
if (message != null) { | ||
log.debug(message) | ||
} | ||
} | ||
|
||
override fun info(message: String?) { | ||
if (message != null) { | ||
log.info(message) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters