-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[native-image] Logback RollingFileAppender does not compile in native image #1323
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
[native-image] Logback RollingFileAppender does not compile in native image #1323
Comments
Repo branch to demonstrate the issue: https://github.com/hhandoko/scala-http4s-realworld-example-app/tree/chore/rolling_file_log_appender Run |
I faced with the same problem when I tried to use native-image for my application. I don't know why runtime initialization failed in your case but build-time initialization failure is absolutely correct: logback opens FileOutputStream (and corresponding file descriptors in OS) on logging initializing and native-image forbids it because these file descriptors won't exist at runtime. |
Thanks for the tips @qdeee , do you have this example in GitHub / open source repo by any chance? |
Could you share your solution please? |
Guys, any update on this issue? |
Your solution works for me @begrossi ! Thanks 👍 My code (Scala) with the working solution can be seen on the PR link above. |
@hhandoko, can you reopen this since its just a workaround? |
Hi there, I'm getting the error below while compiling into native-image:
|
This is a similar issue to #807 .
Logback works fine with
ConsoleAppender
, no specialnative-image
configuration needed. I've been having problems trying to setup logback'sRollingFileAppender
. Adding this class to runtime initialization resulted in a the following error:However, adding this class at build-time initialization also throws an error, as below:
Note that I've added and configured logback reflection file as found in: https://github.com/sdeleuze/graal-issues/blob/master/logback/graal.json
The text was updated successfully, but these errors were encountered: