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

Support threshold on FileLogEventObserver #77

Merged
merged 1 commit into from
Jan 22, 2023

Conversation

norrs
Copy link
Contributor

@norrs norrs commented Jan 19, 2023

This allows the user to configure a threshold on the observer to avoid logging messages to a file which is below a provided threshold.

This allows the user to configure a threshold on the observer to avoid
logging messages to a file which is below a provided threshold.
@norrs
Copy link
Contributor Author

norrs commented Jan 19, 2023

Use case: We want to send all log levels to our humio endpoint, and only above a provided threshold to file.

Yes, its odd, but this is what we want due to the platforms we are running our software on..

Does this make sense for you @jhannes ?

In the end this ends up probably supporting rest of the configuration provided in AbstractFilteredLogEventObserver:

  observer.foo.filter=WARN,INFO@marker=INTERESTING
  observer.foo.suppressMarkers=HTTP_NOT_MODIFIED
  observer.foo.requireMarker=HTTP
  observer.foo.requireMdc.user=tester1|tester2
  observer.foo.suppressMdc.requestPath=/status

as well.

Should it be added to FileLogEventObserver javadoc as well? Copy/paste? I only included the .threshold one..

@norrs
Copy link
Contributor Author

norrs commented Jan 19, 2023

And Java CI probably requires updates of some token I suppose:

image

Copy link
Owner

@jhannes jhannes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The failing test is probably while uploading to coveralls, which shouldn't happen on forks

@jhannes
Copy link
Owner

jhannes commented Jan 20, 2023

@norrs Thank you for the contribution

@norrs
Copy link
Contributor Author

norrs commented Jan 20, 2023

@jhannes Let me know when you can release it.

I'm eagerly waiting to bump to the version so I can close an internal ticket to done and delivered ;-)

@jhannes jhannes merged commit d45cc70 into jhannes:main Jan 22, 2023
@jhannes
Copy link
Owner

jhannes commented Jan 22, 2023

Release 0.4.4 is uploaded to Maven central and will soon be available 🚀

@jhannes
Copy link
Owner

jhannes commented Jan 22, 2023

FileLogEventObserver is quite complex and I'm not sure the functionality included matches all use cases well. It supports patterned file names (so different events can go to different files) and rotation (so that old logs will be compressed and eventually deleted). For efficiency, I'm trying to keep a number of open FileChannels and to avoid recurring errors, I've implemented a circuit breaker.

I'm open to reexamine the functionality and code structure here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants