Logger

Moved

Total Downloads: 3,431 - First Release: Oct 22, 2014 - Last Update: Dec 12, 2017

5/5, 24 likes
  1. For Hurtworld console comand i write mini-plugin

    Code:
    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:
    07:39 [Info] [ComandConsole] version
     
  2. please update logger it causes ALOT OF LAG 21235ms
    and the lag is like 30 sec,s delay
     
  3. Wulf

    Wulf Community Admin

    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. holy moly your are replying fast credit for that :)

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

    Wulf Community Admin

    Nothing has changed with it, still the same simplistic methods. Perhaps the server you are using is overloaded or oversold?
     
  6. 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

    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.
     
  8. okay thanks for the helping :)
     
  9. Wulf,

    It's Good. I have create Plugin for logs-file ChatCommand in Hurtworld
     
    Last edited by a moderator: Apr 24, 2017
  10. Great plugin, recently was seeing some lag showing up:
    Code:
    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:
    void Log(string filename, string text)
            {
                LogToFile(filename, $"[{DateTime.Now}] {text}", this);
                if (logToConsole) Puts(text);
            }
    CSharpPlugin.cs Line 408 - LogToFile
    Code:
    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

    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. Help. No support BetterChat. No logs all with 05/09/2017
     
    Last edited by a moderator: May 27, 2017
  13. Wulf

    Wulf Community Admin

    It shouldn't need to support it, it isn't interacting with the chat.
     
  14. No logs with 05/09/2017 Rust
     
  15. Wulf

    Wulf Community Admin

    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. 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

    Please use English when posting. Also, did you modify the file? That isn't the exact code from my plugin.
     
  18. Is there a way to get Logger to log "No Clip"?
     
  19. Wulf

    Wulf Community Admin

    No, that's a client command; never sent to the server.