Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dansiviter opened this issue Jun 5, 2019 · 2 comments
Assignees
Labels
api: logging Issues related to the googleapis/java-logging API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@dansiviter
Copy link

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.

@chingor13 chingor13 transferred this issue from googleapis/google-cloud-java Dec 4, 2019
@chingor13 chingor13 added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Dec 4, 2019
@google-cloud-label-sync google-cloud-label-sync bot added the api: logging Issues related to the googleapis/java-logging API. label Jan 29, 2020
@minherz
Copy link
Contributor

minherz commented Jan 2, 2022

Thank you for your proposal. Indeed it enhances the abilities to customize the published logs by introducing a common logic across the application. We consider this change to be a breaking change. It cannot be implemented without either creating a flow that duplicates the existing method or by changing the existing LoggingEnhancer interface. It means this change can be introduced only within the next major release.
Please, see if the next release (probably 3.6) that introducing automatic metadata population helps you with some of the tasks for automatic log entry enhancement. See PR #808 for more details.

@losalex losalex self-assigned this Jul 6, 2022
@losalex losalex added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Jul 6, 2022
@losalex
Copy link
Contributor

losalex commented Jun 22, 2023

I am closing this issue since seems it is pretty old and apparently seems there is no much demand for this feature - please let me know if anyone thinks otherwise

@losalex losalex closed this as completed Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/java-logging API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
4 participants