Skip to content

Structured log using LoggingAppender #990

@Kamui123

Description

@Kamui123

Hi,

Is it possible to create structured log using LoggingAppender?
I managed to do it using ch.qos.logback.core.ConsoleAppender and net.logstash.logback.encoder.LogstashEncoder

<appender name="LOGBOOK" class="ch.qos.logback.core.ConsoleAppender">
    <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>

but now instead of logging it to console I would like to use specific named log to separate it from stdout.

<appender name="LOGBOOK" class="com.google.cloud.spring.logging.LoggingAppender">
    <log>logbook</log>
</appender>

This configuration works but logs are not structure. Log json is printed as string.

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/java-logging-logback API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions