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

JaninoEventEvaluator Doesn't support Marker #800

Closed
matt19870107 opened this issue Apr 5, 2024 · 3 comments
Closed

JaninoEventEvaluator Doesn't support Marker #800

matt19870107 opened this issue Apr 5, 2024 · 3 comments
Assignees
Labels

Comments

@matt19870107
Copy link

I want to filter my log per the expression marker != null && (marker.contains("SYSTEM_OUT") || level==ERROR).
But recently I upgraded the logback to the latest version and found it doesn't work.
I checked the document and it says it still supports marker, see https://logback.qos.ch/manual/appenders.html#marker_JaninoEventEvaluator.
But from the source code I see it has already comment out https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/boolex/JaninoEventEvaluator.java#L50.
I also tried to workaround this by adding two appenders and one for log level filter and another for OnMarkerEvaluator, but the performance decreased significantly and it would be obvious if I have a large set of data that need to be logged.
Any thoughts on this?

@ceki ceki self-assigned this Apr 8, 2024
@ceki
Copy link
Member

ceki commented Apr 8, 2024

@matt19870107 Thank you for this report.

EventEvalutator should not be confused with EvaluatorFilter. The former is for computing a "triggering" event whereas the latter is for filtering. However, an JaninoEventEvaluator can be nested within an ch.qos.logback.core.filter.EvaluatorFilter.

In any case, your remarks regarding JaninoEventEvaluator and markers are valid and are being fixed.

@matt19870107
Copy link
Author

@ceki May I know the plan for when we can get it fixed then I can decide to workaround this or I can wait for the fix?

@ceki
Copy link
Member

ceki commented Apr 9, 2024

@matt19870107 Fixed in commit 61140ea. Logback version 1.5.4 containing this fix has been released earlier today.

See also the updated documentation and in particular the new markerList variable.

Do not hesitate to report back your results.

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

No branches or pull requests

2 participants