Raised This Month: $ Target: $400

Log flusher

Post New Thread Reply   
Thread Tools Display Modes
Join Date: Nov 2009
Plugin ID:
Plugin Version:
Plugin Category:
Server Management
Plugin Game:
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Periodically flushes the server log file
    Old 02-15-2010 , 22:44   Log flusher
    Reply With Quote #1

    Log flusher

    Background: srcds writes various messages to a log file. By default, some amount of logs are buffered in the process memory before being flushed to the log file. Depending on the amount of activity on your server and the logging options, a flush happens anywhere between every few seconds to every few hours. If the srcds process crashes or is stopped untidily, the logs that are buffered in memory are lost and not written to the disk.

    This can be solved using the sv_logflush server variable, which is set to 0 by default. Setting it to 1 will cause the server to update the log file for every single log message. So if the process crashes no log lines are lost. However, this is I/O-intensive, especially if a machine runs several game servers.

    What this plugin does: This plugin flushes the log file periodically every X seconds (600 by default, i.e. 10 minutes). That way, when the server crashes or is closed untidily, some logs are lost but not too much. Another use for this plugin is in conjunction with systems that parse the server log files, to ensure they feed on "fresh" log data that's no older than X seconds. For example, PsychoStats, which continuously updates player ranking statistics.


    logflush (default: 600). 0 = disable logflush plugin. Anything else is the number of seconds between log flushes.


    • Put the plugin in your addons/sourcemod/plugins directory
    • The configuration file will be created when the plugin is first run under cfg/sourcemod/plugin.logflush.cfg
    Attached Files
    File Type: sp Get Plugin or Get Source (logflush.sp - 1160 views - 1.3 KB)

    Last edited by mad_hamster; 08-23-2010 at 07:46. Reason: Added FCVAR_PLUGIN
    mad_hamster is offline

    Join Date: May 2008
    Old 03-02-2010 , 10:03   Re: Log flusher
    Reply With Quote #2

    You public cvar is missing the notify flag.
    psychonic is offline
    Join Date: Nov 2009
    Old 03-08-2010 , 08:56   Re: Log flusher
    Reply With Quote #3

    Indeed. Fixed.
    mad_hamster is offline

    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump

    All times are GMT -4. The time now is 14:42.

    Powered by vBulletin®
    Copyright ©2000 - 2023, vBulletin Solutions, Inc.
    Theme made by Freecode