Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=com.github.ankurcha
name=gcloud-logging-slf4j-logback
version=1.1.11
version=1.2.0
17 changes: 17 additions & 0 deletions src/main/java/com/google/cloud/logging/CustomAttributes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.google.cloud.logging;

import java.util.Map;

public class CustomAttributes {

private final Map<String, Object> attributes;

public Map<String, Object> getAttributes() {
return attributes;
}

public CustomAttributes(Map<String, Object> attributes) {
this.attributes = attributes;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ protected Map toJsonMap(ILoggingEvent event) {
if (arg instanceof HttpRequestContext) {
reqCtx = (HttpRequestContext) arg;
}

if (arg instanceof CustomAttributes) {
Map<String, Object> attributes = ((CustomAttributes) arg).getAttributes();
if (attributes != null) {
builder.putAll(attributes);
}
}
}
}

Expand Down