Jump to content
battleguard

Storing log output to file that is created at runtime

Recommended Posts

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...