Jump to content

Storing log output to file that is created at runtime


Recommended Posts

Posted

I have a problem where I am making a folder hierarchy that has a folder for each run and a folder for each account being ran. This works great for saving off everything, but I cannot seem to find a way to change where the script logging output goes at runtime. Currently I log the script output using intellij's save console to output file feature, but I need to change the folder path at runtime so this wont work.

- Things I have tried or thought about
- redirecting output of jar using > out.txt in command line arguments but once again this is not runtime
- redirecting system output using System.setOut(printstream), but once again the super locked down jar does not support this feature sadly
- I can change all my calls in the entire script from the bots logger to a custom logger that I have implemented that saves the output to a fiile

 

So far this is all I have thought of and I really do not like the idea of using the final option.

Posted
On 19/01/2018 at 7:08 PM, battleguard said:

I have a problem where I am making a folder hierarchy that has a folder for each run and a folder for each account being ran. This works great for saving off everything, but I cannot seem to find a way to change where the script logging output goes at runtime. Currently I log the script output using intellij's save console to output file feature, but I need to change the folder path at runtime so this wont work.

- Things I have tried or thought about
- redirecting output of jar using > out.txt in command line arguments but once again this is not runtime
- redirecting system output using System.setOut(printstream), but once again the super locked down jar does not support this feature sadly
- I can change all my calls in the entire script from the bots logger to a custom logger that I have implemented that saves the output to a fiile

 

So far this is all I have thought of and I really do not like the idea of using the final option.

I tried this before... the only viable solution I came up was to create a custom logger. 

I'm sure there's some way to override the log() method though. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...