Skip to content

fix: log4j appender throwing null pointer exception #28

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndresArcones
Copy link

@AndresArcones AndresArcones commented Jul 10, 2024

In the current implementation of the log4j ScalyrAppender, the getLayout() method will always return null because the layout is not being read. This occurs because the requiresLayout() method is set to return false in ScalyrAppender. As a result, even if a layout is configured for this appender in the logger configuration, it will not be utilized. To fix this issue, the requiresLayout() method should return true, allowing the layout to be read and applied properly.

For reference, see the Appender class in Apache Log4j where requiresLayout() is used to determine if a layout is required.

@AndresArcones
Copy link
Author

AndresArcones commented Apr 23, 2025

is there any maintainers on this repository that have the right to merge this pull request? @steve-scalyr @soboko @moriarty-s3a @rvangsgaard @moriarty-s3a @ArthurKamalov

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.

1 participant