[ADMN] ServerLogSaver v2.1.0 - Backup and Clear the log in your own way! [1.1-R4]

Discussion in 'Inactive/Unsupported Plugins' started by Laserhog, Sep 6, 2011.

  1. Offline

    Laserhog

    ServerLogSaver
    Version 2.0​
    Description

    WHEN UPDATING TO 2.0, PLEASE LET A NEW CONFIG GENERATE.
    Simply put, this will backup the server.log file to a directory, and then clear the existing server.log file. This is to reduce RAM usage of the server host and effectively reduce lag for server players.
    Most of the functions in this are configurable, such as backup location, time delay between backups, choice of Size and Time rotations and more!

    *This post will not be always up-to-date, BukkitDev is however*

    Download the Jar

    Download the Source
    Commands
    • /sls copy
    • /sls zip
    Current Features
    • User defined time for backup intervals (default time is 1 day, 1440 minutes)
    • Backups are time stamped for ease of use
    • Compress the logs
    • Check for 0 byte content
    • Console notice (optional)
    • Choice of time/size/restart rotations
    • User defined backup storage location
    • User defined backup file names (prefix and time setup)
    • In-game command
    • Choose the number of logs to keep before purging
    To-Do
    • Record commands used in a separate file
    • need more ideas, feed back would help :D
    Change-Log

    Version 2.1.0
    • Choose the number of logs to keep before purging
    Version 2.0.2
    • No longer backs up as soon as the server starts with 'time' rotation
    Version 2.0.1
    • Added 'restart' rotation choice
    Version 2.0
    • Updated to new config
    • Added in-game commands
    • Complete re-code
    Version 1.1
    • Added configuration of backup location
    • Added configuration of backup name
    Old Changes (open)


    Version 1.0
    • Release of v1.0
    • Added configuration of size/time rotations
    • Added a console message choice on backup
    Version 0.2.1b
    • Added configuration of compression, true for zip, false for normal copy
    Version 0.2b
    • Added Log Compression using zip
    • Added 0 byte content checks, won't back up if the server.log is 0 bytes, and waits till the next cycle to check again
    Version 0.1.1b
    • Fixed problem where spaces weren't handled properly and made new directories with %20 as the space
    Version 0.1b
    • Beta Release ServerLogSaver
     
    kahlilnc and zipfe like this.
  2. Offline

    Juze

    @Laserhog : Doesn't seem to be working on #1550 anymore. Doesn't save the logs to seperate files but says to be enabled.
     
  3. Offline

    Laserhog

    Hmm, that is odd. Its not even heavily dependant on the bukkit API so i don't know what could be wrong with it.
    Possibly its something to do with my re-code? But i tested it and it seems to be working fine. Please show me your config and maybe i can try re-create the issue.
    Also, for now i am on holiday is Australia so i can't work on it until i get back, although i can test it and try find what's wrong.

    EDIT: Ok so i did some testing and, im assuming you are using the default config, that is how it is meant to work as it is by default doing size based rotations and will only back up if the log size is greater than the specified size in the config. I think i may do a full on description of both rotation types in the main post so as to reduce further confusion from others.
    I hope this helped :D
     
  4. Offline

    Juze

    What has changed is that it doesn't print that fancy multiline ServerLogSaver thingy at the start of the logs or in console anymore (I haven't updated), sometimes on server shutdown the logs may get empty -> Resulting in empty logs and sometimes it doesn't even archive the logs, having multiple days of logs in one file.

    EDIT: This is my latest server.log in root, without the ServerLogSaver thing:

    Code:
    2011-12-08 04:43:03 [INFO] [g] [Member] +neo131xzero: bACK...
    2011-12-08 04:43:30 [INFO] Connection reset
    2011-12-08 04:43:31 [INFO] neo131xzero lost connection: disconnect.endOfStream
    2011-12-08 04:56:19 [INFO] Read timed out
    2011-12-08 04:56:19 [INFO] Medabot lost connection: disconnect.endOfStream
    2011-12-08 05:09:18 [INFO] Whitelist: Player rossavage is trying to join...
    2011-12-08 05:09:18 [INFO] Disconnecting rossavage [/-snip-:60481]: Sorry, you are not on the whitelist!
    2011-12-08 05:21:05 [INFO] /-snip-:63315 lost connection
    2011-12-08 05:35:44 [INFO] /-snip-:60539 lost connection
    2011-12-08 05:37:58 [INFO] Whitelist: Player joelpoel1 is trying to join...
    2011-12-08 05:37:58 [INFO] Disconnecting joelpoel1 [/-snip-:50108]: Sorry, you are not on the whitelist!
    2011-12-08 06:07:31 [INFO] Whitelist: Player rossavage is trying to join...
    2011-12-08 06:07:31 [INFO] Disconnecting rossavage [/-snip-:61714]: Sorry, you are not on the whitelist!
    2011-12-08 07:09:24 [INFO] Whitelist: Player grooveboy101 is trying to join...
    2011-12-08 07:09:24 [INFO] grooveboy101 [/-snip-:51002] logged in with entity id 7180 at ([world] -1.8279729499350168, 68.0, -10.632226627538751)
    2011-12-08 07:10:02 [INFO] [-snip-] grooveboy101 fell into the Gap
    2011-12-08 07:11:02 [INFO] grooveboy101: Setting grooveboy101 to game mode 1
    2011-12-08 07:11:09 [SEVERE] Could not pass event BLOCK_PHYSICS to -snip-
    java.lang.NullPointerException
    2011-12-08 07:11:12 [SEVERE] Could not pass event BLOCK_PHYSICS to -snip-
    java.lang.NullPointerException
    2011-12-08 07:11:12 [SEVERE] Could not pass event BLOCK_PHYSICS to -snip-
    java.lang.NullPointerException
    2011-12-08 07:11:12 [SEVERE] Could not pass event BLOCK_PHYSICS to -snip-
    java.lang.NullPointerException
    2011-12-08 07:12:17 [SEVERE] Could not pass event BLOCK_PHYSICS to -snip-
    java.lang.NullPointerException
    2011-12-08 07:12:38 [SEVERE] Could not pass event BLOCK_PHYSICS to -snip-
    java.lang.NullPointerException
    2011-12-08 07:13:39 [SEVERE] Could not pass event BLOCK_PHYSICS to -snip-
    java.lang.NullPointerException
    2011-12-08 07:13:52 [INFO] grooveboy101 lost connection: disconnect.quitting
    2011-12-08 07:13:52 [INFO] Connection reset
    2011-12-08 07:59:00 [INFO] [BackupPlugin]  Starting backup process..
    2011-12-08 07:59:00 [INFO] [BackupPlugin]  Rebuilding Cache. This can take several minutes, depending on the world size.
    2011-12-08 07:59:35 [INFO] [BackupPlugin]  deleting old backup file: world-backups/world_20111203-1159530565.zip
    2011-12-08 07:59:35 [INFO] [BackupPlugin]  Backup sucessfull
    2011-12-08 08:09:29 [INFO] Read timed out
    2011-12-08 08:09:29 [INFO] Disconnecting /-snip-:56108: Took too long to log in
    2011-12-08 08:29:07 [INFO] [BackupPlugin]  Deleting cache, might be obsolete.
    2011-12-08 08:29:08 [INFO] [BackupPlugin]  Cache lifetime ended.
    2011-12-08 09:56:56 [INFO] /-snip-:49253 lost connection
    
     
  5. Offline

    Laserhog

    You are using version 2.0 right? I forgot to re-add the console message in this version so that is why that isn't showing.
    I still don't know whether you are doing time or size rotations and i don't know why this is happening.
    If you are not using 2.0 however you should definitely update as the config methods used in previous versions are deprecated, hence why i made 2.0.
     
  6. Offline

    microskies

    I get this error on start-up:

    Code:
    2011-12-09 20:50:29 [INFO] [ServerLogSaver] Version 2.0 Is Enabled!
    2011-12-09 20:50:29 [SEVERE] Error occurred while enabling ServerLogSaver v2.0 (Is it up to date?): null
    java.lang.NullPointerException
        at me.laserhog.ServerLogSaver.ServerLogSaver.onEnable(ServerLogSaver.java:124)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:182)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:165)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:337)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:324)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:161)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:388)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    2011-12-09 20:50:29 [INFO] [ServerLogSaver] Version 2.0 Is Enabled!
    2011-12-09 20:50:29 [SEVERE] Error occurred while enabling ServerLogSaver v2.0 (Is it up to date?): null
    java.lang.NullPointerException
        at me.laserhog.ServerLogSaver.ServerLogSaver.onEnable(ServerLogSaver.java:124)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:182)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:165)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:337)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:324)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:161)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:388)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    And it doesn't seem to be saving logs at all.

    My config:
    Code:
    Use_Custom_Location: false
    Custom_Location: ''
    Custom_backup_prefix: ''
    Custom_backup_time_layout: yyyy_MM_dd_HH.mm.ss
    Zip_backups: true
    Size_Rotations: false
    Max_Log_Size_kb: 400.0
    TimeDelay_minutes: 1440.0
    Show_Console_Message: true
    
    :)

    Erm, sorry, that may be my mistake for having two of the .jar files in my /plugins ill check now

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  7. Offline

    Laserhog

    @microskies
    It's saying that you're using version 2.0 but im not sure you are.
    EDIT: Ok i think the problem is that you need to let a new config file load. Same with @Juze . Sorry, i should have put a message in the top.
    WHEN UPDATING TO 2.0, PLEASE LET A NEW CONFIG GENERATE.
     
  8. Offline

    microskies

    Yeah, thanks :D I should have tried that first really, I didn't realise I was updating, as I've just migrated hosts, so I just assumed it was the same download as the other XD My bad :)
     
  9. Offline

    Juze

    @Laserhog : Thanks, but as always, the BukkitDev pages etc are missing information on the config values, such as RotationChoise. I don't know how to change it...

    EDIT: Figured RotationChoise from the comments in config...
     
  10. Offline

    hqSparx

    why is serverlogsaver making new log everytime I restart my server? should be every 24hours or so
     
  11. Offline

    Laserhog

    It does backup every 24 hours, starting from when the server starts, but it also backs up straight away when the server starts.
     
  12. Offline

    hqSparx

    could i disable this?
    im running autorestarts plugin
     
  13. Offline

    hqSparx

    please?
     
  14. Offline

    Laserhog

    My recommendation to you is to use the Size Based Rotations instead if you have an auto restarter as when the server restarts the wait time is lost and reset to 0 so it restarts the scheduler again. Or you could set the time between backups to really high so it only ever backs up when the server restarts.
    I really hope this helps...
     
  15. Offline

    fawlcun

    This is a great plugin. It saves me a lot of trouble having to manually archive large server.log files.
     
  16. Offline

    Laserhog

    New version out. Only added a new rotation choice, 'restart'.
    Here

    Updated again, this time changing the fact that the server backs up as soon as you start it. This has been quite an annoyance for people so i finally fixed it
    :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  17. Offline

    md_5

    Long time no see Laserhog. You will notice that this thread has now been placed into the Inactive Plugin subforum.
    If you wish to revive this plugin, please ensure that you update and test compatibility with the latest recommended Bukkit build before reporting your original post, asking for it to be moved back to the release forum.

    Thanks for your time.
    md_5
     

Share This Page