We pump our logs to stackdriver from a pretty standard spring boot application with logback. As it is now we can't see the name of the logger in logback.
So if the class (from external dependency) com.autumnframework.core.SomeUtil writes a log statement, we can't see that it came from that class. For instance, if we want to silence it, it is pretty hard.
I think this should be set automatically.
I have had a look at com.google.cloud.logging.logback.LoggingAppender:
private LogEntry logEntryFor(ILoggingEvent e) {
StringBuilder payload = new StringBuilder(e.getFormattedMessage()).append('\n');
writeStack(e.getThrowableProxy(), "", payload);
Level level = e.getLevel();
LogEntry.Builder builder =
LogEntry.newBuilder(Payload.StringPayload.of(payload.toString().trim()))
.setTimestamp(e.getTimeStamp())
.setSeverity(severityFor(level));
builder
.addLabel(LEVEL_NAME_KEY, level.toString())
.addLabel(LEVEL_VALUE_KEY, String.valueOf(level.toInt()));
Can easily be expanded with:
builder.addLabel("logger_name", e.getLoggerName());
Is this a good idea? I can make a pull request, or fork.
We pump our logs to stackdriver from a pretty standard spring boot application with logback. As it is now we can't see the name of the logger in logback.
So if the class (from external dependency) com.autumnframework.core.SomeUtil writes a log statement, we can't see that it came from that class. For instance, if we want to silence it, it is pretty hard.
I think this should be set automatically.
I have had a look at com.google.cloud.logging.logback.LoggingAppender:
Can easily be expanded with:
Is this a good idea? I can make a pull request, or fork.