JavaPackager icon indicating copy to clipboard operation
JavaPackager copied to clipboard

How to redirect stderr to a file?

Open Ryanznoco opened this issue 2 years ago • 9 comments

I'm submitting a feature request.

How do I redirect stderr to a file?

Ryanznoco avatar Nov 20 '23 14:11 Ryanznoco

Do you mean JVM errors?

fvarrui avatar Nov 20 '23 14:11 fvarrui

Yes

Ryanznoco avatar Nov 20 '23 14:11 Ryanznoco

Which system? All of them?

fvarrui avatar Nov 20 '23 14:11 fvarrui

Windows only.

Ryanznoco avatar Nov 20 '23 14:11 Ryanznoco

Ok, I'll take a look into it and tell you something

fvarrui avatar Nov 20 '23 14:11 fvarrui

Ok, thanks a lot.

Ryanznoco avatar Nov 20 '23 14:11 Ryanznoco

One question: have you tried winConfig.headerType=console and then run your app from terminal?

fvarrui avatar Nov 30 '23 16:11 fvarrui

It works, but is there no other way? I don't want to run a terminal.

Ryanznoco avatar Jan 13 '24 05:01 Ryanznoco

How do I redirect stderr to a file?

Maybe this should do the job 🤷‍♂️

System.setErr(new PrintStream("error.txt"));

or you can use a Logger.

fvarrui avatar Feb 25 '24 21:02 fvarrui