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

java.util.logging not working in native image #728

Closed
dsyer opened this issue Oct 9, 2018 · 7 comments
Closed

java.util.logging not working in native image #728

dsyer opened this issue Oct 9, 2018 · 7 comments
Assignees

Comments

@dsyer
Copy link

dsyer commented Oct 9, 2018

import java.util.logging.Logger;

public class Loggers {

	public static void main(String[] args) throws Exception {
		new Loggers().run();
	}

	private void run() throws Exception {
		Logger.getLogger(Loggers.class.getName()).info("Hello World");
	}

}

In a normal JVM:

Oct 09, 2018 4:17:58 PM Loggers run
INFO: Hello World

This app runs with no errors but doesn't log anything in SVM.

@cstancu cstancu self-assigned this Oct 11, 2018
@sdeleuze
Copy link
Collaborator

This is annoying because Logback and Log4j2 are not working with Substrate VM yet, so making that one supported would at least provide a solution to get logs with Graal native images, which seems a pretty basic need.

@sdeleuze
Copy link
Collaborator

@pekd
Copy link
Contributor

pekd commented Nov 16, 2018

You could try to add your own Handler that prints log messages to System.out / System.err.

@dsyer
Copy link
Author

dsyer commented Nov 16, 2018

You could try to add your own Handler that prints log messages to System.out / System.err.

Isn't that what the default ConsoleHandler already does?

@dsyer
Copy link
Author

dsyer commented Nov 16, 2018

Interestingly, the sample above (same as @sdeleuze 's) works for me if I add --no-server to the native-image command line (similarly it works the first time if there is no existing daemon, and then fails subsequently). So there is something weird about the state in the daemon.

@cstancu
Copy link
Member

cstancu commented Mar 5, 2019

This is fixed in 1f851ca which will be available in rc14.

@cstancu
Copy link
Member

cstancu commented Mar 14, 2019

I added some java.util.logging documentation .

zakkak pushed a commit to zakkak/mandrel that referenced this issue May 16, 2024
…inal

Unmark suites and bump version to 23.1.3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants