Logger

Configurable logging of chat, commands, connections, and more

Total Downloads: 2,573 - First Release: Oct 22, 2014 - Last Update: Sep 13, 2017

5/5, 21 likes
  1. i-593

    i-593 Naked Wanderer

    For Hurtworld console comand i write mini-plugin

    Code (Text):
    namespace Oxide.Plugins
    { //Начало
        [Info("ComandConsole", "i-593", 1.0)]
        [Description("Plugin for log console comand in console history")]

        class ComandConsole : HurtworldPlugin  
    {
           void Init()
    {
        Puts("ComandConsole Init!"); //message for load plugin
    }
         void OnServerCommand(string command)
    {
        Puts(command); //message "comand" in console;
    }
    }
    } //Конец
    This plugin void ServerConsoleComand and write his in console. I dont know how write logs-file create.
    Please his search in log-oxcide "ComandConsole" - and create log-comand-console-date

    This plugin not write comand on chat-comand. ((((

    In my log "oxcide_2017..."
    Code (Text):
    07:39 [Info] [ComandConsole] version
     
  2. ulrikvn No Comment!!!

    ulrikvn No Comment!!! Naked Wanderer

    please update logger it causes ALOT OF LAG 21235ms
    and the lag is like 30 sec,s delay
     
    Togoshige likes this.
  3. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    That isn't something I can fix, the plugin is pretty basic and barely does anything other than log to files. You may want to consider looking into the possibility that your server's hardware does not have adequate filesystem I/O.
     
  4. ulrikvn No Comment!!!

    ulrikvn No Comment!!! Naked Wanderer

    holy moly your are replying fast credit for that :)

    but it worked fine before 3 weeks or so?
     
  5. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Nothing has changed with it, still the same simplistic methods. Perhaps the server you are using is overloaded or oversold?
     
  6. ulrikvn No Comment!!!

    ulrikvn No Comment!!! Naked Wanderer

    im hosting on gameservers they provide with 4gb after i unloaded logger te server stopped crashing and being ram killed
    it is because i have 70 plugins on my server :D
     
  7. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    The constant logging of connections, commands, etc. based on your settings can be tasking if the host's hardware is limited. There isn't anything that I can do about that, the server just needs to be capable of handling frequent output.
     
    Togoshige likes this.
  8. ulrikvn No Comment!!!

    ulrikvn No Comment!!! Naked Wanderer

    okay thanks for the helping :)
     
  9. i-593

    i-593 Naked Wanderer

    Wulf,

    It's Good. I have create Plugin for logs-file ChatCommand in Hurtworld
     
    Last edited by a moderator: Apr 24, 2017
  10. Togoshige

    Togoshige Shack Builder Plugin Developer

    Great plugin, recently was seeing some lag showing up:
    Code (Text):
    Calling 'OnUserChat' on 'Logger v2.0.3' took 439ms
    Calling 'OnServerCommand' on 'Logger v2.0.3' took 1103ms
    I poked into the code a little bit

    Logger.cs line 167
    Code (Text):
    void Log(string filename, string text)
            {
                LogToFile(filename, $"[{DateTime.Now}] {text}", this);
                if (logToConsole) Puts(text);
            }
    CSharpPlugin.cs Line 408 - LogToFile
    Code (Text):
    protected void LogToFile(string filename, string text, Plugin plugin, bool timeStamp = true)
            {
                var path = Path.Combine(Interface.Oxide.LogDirectory, plugin.Name);
                if (!Directory.Exists(path)) Directory.CreateDirectory(path);
                filename = $"{plugin.Name.ToLower()}_{filename.ToLower()}{(timeStamp ? $"-{DateTime.Now:yyyy-MM-dd}" : "")}.txt";
                using (var writer = new StreamWriter(Path.Combine(path, Utility.CleanPath(filename)), true)) writer.WriteLine(text);
            }
    Oxide/CSharpPlugin.cs at 05d9949eee03d11c513b4a57ef1fa6961040edc7 · OxideMod/Oxide · GitHub

    Im curious if it would be faster to setup path, check directory and open StreamWriter all one time, vs every time.
    Rapid Opening and Closing System.IO.StreamWriter in C#

    In recent past I have used NLog, with async writes and flush and close at end.

    Anyways, Just posted this all as something to think about, not sure if its an issue or not.
     
  11. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    The LogToFile method has a lot of things that can be improved with it, but that isn't related to this plugin. If you'd like to discuss it, please open an issue on GitHub or a separate thread, thanks. :)
     
  12. diman96ru

    diman96ru Wood Hoarder

    Help. No support BetterChat. No logs all with 05/09/2017
     
    Last edited: May 27, 2017
  13. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    It shouldn't need to support it, it isn't interacting with the chat.
     
  14. diman96ru

    diman96ru Wood Hoarder

    No logs with 05/09/2017 Rust
     
  15. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    The plugin logs all chat from the game to Oxide/logs; it doesn't need to be compatibly with anything as there are no conflicts.
     
  16. iaZeGamer

    iaZeGamer Naked Wanderer

    Consegui corrigir todos os erros, exceto este:
    Logger.cs (125,13): erro CS0103: O nome 'logToFile' não existe no contexto atual

    {
    LogToFile (filename, $ "[{DateTime.Now}] {text}", este);
    If (logToConsole) Coloca (texto);
    }
     
  17. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Please use English when posting. Also, did you modify the file? That isn't the exact code from my plugin.
     
  18. Benn13

    Benn13 Scavenger

    Is there a way to get Logger to log "No Clip"?
     
  19. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    No, that's a client command; never sent to the server.
     
    Benn13 likes this.
  20. !Dark!

    !Dark! Naked Wanderer