Clearing server.log

Discussion in 'Plugin Development' started by Laserhog, Sep 6, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Laserhog

    I am trying to make a plugin atm and am running into some troubles with how to delete a file while it is in use. The particular file is the server.log and i was wondering if you knew of any round about way to do this. My ideas were something like stopping the server, deleting it, restarting the server, but these brought up more problems for me as to how would the plugin run with the server stopped or even how could it restart the server again when the plugin isn't running.
    Any help would be appreciated.
     
  2. Offline

    geekygenius

    Why would you want to delete the log file?
     
  3. Offline

    Laserhog

    As i said, its for a plugin I'm making. Simply put, it will back up the server.log file periodically, time stamp it, then delete the original so as the server.log file doesn't get ridiculously big as I've heard it does sometimes and lag the server. I have finished everything except for the deleting of the server.log which is being a real annoyance.
     
  4. Have a look at this.
     
  5. Offline

    Laserhog

    Shit, well i still wanna make it, i wasn't planning on releasing it. Its soley for helping me learn to actually write them, and also for a friends server. Looking at this one it seems to be a couple builds old so idk i may post it still.
    Thanks for showing me this, although i cant see a source so i can't learn from what hes done.




     
  6. It's still compatible to bukkit 1060 and the sources are included in the jar file. ;)
     
  7. Offline

    Laserhog

    @V10lator
    The code i found worked like a charm. Thank you so much!
     
  8. Don't thank to me, thank to @codename_B as it's his work. :)
     
Thread Status:
Not open for further replies.

Share This Page