Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

server.log archiving

server log archive

  • Please log in to reply
4 replies to this topic

#1

bytesoup
    bytesoup

    Tree Puncher

  • Members
  • 15 posts

Posted 24 January 2013 - 03:55 PM

Hi All, Just joined the forum and been searching but cannot seem to find an answer. Im running a hosted server based on a linux OS and noticed everytime the minecraft java process is stopped it cleans up the server.log file. I would like to be able to archive this log file and I like to parse it and see which players have logged on and IP addresses etc.

I couldn't see a property in the server.properties file so how would I change this behaviour, aside from trying to see if I can write a plugin?

Thanks

Register or log in to remove.

#2

Rogue
    Rogue

    Gambrinous

  • Forum Admin
  • Curse Premium
  • 8734 posts
  • Location: Rochester, NY
  • Minecraft: Rogue
  • Xbox:RogueMurder

Posted 24 January 2013 - 04:11 PM

you're saying that it clears the entire file after stopping? I haven't seen this action normally, what's your startup script look like?

As a note, I would've said you could rotate the logs at starting your server using something in your shell like:
*whatever you have at the start*
$ NOW=$(date +"%m-%d-%Y")
$ FILE=$("$NOW.server.log")
cp server.log oldLogs/$FILE
rm server.log
*java line for minecraft*


but if it's erasing it when you turn it off, then it won't rotate anything at startup.

Quote my post to make sure I see your reply - MCF Hosting CoordinatorPosted Image


#3

bytesoup
    bytesoup

    Tree Puncher

  • Members
  • 15 posts

Posted 24 January 2013 - 04:25 PM

Hi Rogue, thanks for your reply. Our server is running on a creeperhost.net server, from the command line I can see that its just running the java -jar command, it seems to be spawned from a parent process though, note the hostname is changed for obvious reasons:


500      22066 21871  0 19:18 pts/1    00:00:00 grep java
500      25557     1  0 Jan21 ?        00:00:00 SCREEN -dmS minecraft java -Xmx495M -jar craftbukkit.jar someserver.creeperhost.net
500      25558 25557  3 Jan21 pts/0    02:28:22 java -Xmx495M -jar craftbukkit.jar someserver.creeperhost.net

I cannot find the SCREEN command though, the server can be started from a web-based control panel. I suppose I could trigger the server from the cli with a "nohup" but this might mean the web control panel cannot restart the server.

So is it normal behaviour for the server to just leave the logs there, is there any archive / rotation function built into the minecraft server?

#4

bacon_avenger
  • Minecraft: bacon_avenger

Posted 24 January 2013 - 08:34 PM

As far as I've seen, there isn't any log rotation built into the MC server code.  If you are running a bukkit server, this plugin may do the trick for you.  It's not been updated in a while, but it still seems to do the trick for me.

http://dev.bukkit.or...serverlogsaver/
I ride the bukkit on Linux with a PEX shooter at my side.  Please don't PM me for help, PM's don't help the community at large as it's not publicly viewable.  Use pastie or pastebin for files, I will not download files.  Click the up arrow if I helped. (I also do YT Vids)

#5

bytesoup
    bytesoup

    Tree Puncher

  • Members
  • 15 posts

Posted 25 January 2013 - 09:26 AM

View Postbacon_avenger, on 24 January 2013 - 08:34 PM, said:

...If you are running a bukkit server, this plugin may do the trick for you.  It's not been updated in a while, but it still seems to do the trick for me.

http://dev.bukkit.or...serverlogsaver/

Thanks, I'll look into that.