Skip to content

Commit

Permalink
Refactor 2 (#7)
Browse files Browse the repository at this point in the history
* Develop Branch

Develop branch for refactor 2.

* update .gitignore

* Revert "Develop Branch"

This reverts commit 3ae9647.

* Auto stash for revert of "Develop Branch"

Partial Commit.

* Refactor 2

Adds deploymentStage and contextEnvLanguage to TrakerrClient, changes contextEnvName to be the runtime interpreter name.
  • Loading branch information
RMSD authored Mar 19, 2017
1 parent 53493e0 commit b79ed64
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 197 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ target
.settings/
.classpath
.project

*.iml
8 changes: 4 additions & 4 deletions src/main/java/io/trakerr/client/TrakerrAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ public void activateOptions() {
protected void append(LoggingEvent loggingEvent) {
if (!this.enabled) return;

// get classification in propercase (first letter capitalized)
String classification = loggingEvent.getLevel().toString().toLowerCase();
classification = classification.substring(0, 1).toUpperCase() + classification.substring(1);
// get logLevel in propercase (first letter capitalized)
String logLevel = loggingEvent.getLevel().toString().toLowerCase();
logLevel = logLevel.substring(0, 1).toUpperCase() + logLevel.substring(1);

// get event type
ThrowableInformation throwableInformation = loggingEvent.getThrowableInformation();
Throwable throwable = throwableInformation == null ? null : throwableInformation.getThrowable();
String eventType = throwable == null ? loggingEvent.getLoggerName() : throwable.getClass().getName();

// create app event
AppEvent event = this.trakerrClient.createAppEvent(classification, eventType, loggingEvent.getRenderedMessage());
AppEvent event = this.trakerrClient.createAppEvent(logLevel, null, eventType, loggingEvent.getRenderedMessage());

// build the stack trace
event.setEventStacktrace(EventTraceBuilder.getEventTraces(throwable));
Expand Down
Loading

0 comments on commit b79ed64

Please sign in to comment.