Skip to content

Make LoggingEventEnhancer more generic so can be used in more implementations  #32

@dansiviter

Description

@dansiviter

Is your feature request related to a problem? Please describe.
Currently only com.google.cloud.logging.logback.LoggingAppender can enhance using information contained within the logging event. This isn't possible via the JDK logger although it should be.

Describe the solution you'd like
Replace com.google.cloud.logging.logback.LoggingEventEnhancer with com.google.cloud.logging.LoggingEventEnhancer that has a class structure similar to:

@FunctionalInterface
public interface LoggingEventEnhancer<E> {
  void enhanceLogEntry(LogEntry.Builder builder, E event);
}

For backwards compatibility com.google.cloud.logging.logback.LoggingEventEnhancer could then change to:

public interface LoggingEventEnhancer extends com.google.cloud.logging.LoggingEventEnhancer<ILoggingEvent> {
   ...
}

Describe alternatives you've considered
None

Additional context
The JDK logger com.google.cloud.logging.LoggingHandler should then be enhanced to perform the enhancement using the new class. The old com.google.cloud.logging.LoggingEnhancer could be deprecated as its functionality could be subsumed by the new one.

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/java-logging API.priority: p3Desirable enhancement or 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