1. sqroot submitted a new resource:

    CraftLog - Logs crafting and crafter information

    Read more about this resource...
     
  2. Nice! Thanks for this!
     
  3. Code:
    SayMyName started: 546x Explosives. 
    What does the "x"?
     
  4. The quantity
    [DOUBLEPOST=1455191735][/DOUBLEPOST]got this error:
    Code:
    12:25 PM [Error] Failed to call hook 'OnItemCraft' on plugin 'CraftLog v1.0.0'
    Traceback (most recent call last):
      File "CraftLog.py", line 18, in OnItemCraft
      File "CraftLog.py", line 15, in log
    RuntimeError: Failed to call OnItemCraft (DirectoryNotFoundException: Could not find a part of the path "C:\TCAFiles\Users\ChristianF\14256\server\my_server_identity\oxide\logs\crafted.txt".)
      at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
      at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
      at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
      at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0
      at System.IO.StreamWriter..ctor (System.String path, Boolean append) [0x00000] in <filename unknown>:0
      at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
      at System.IO.File.AppendAllText (System.String path, System.String contents) [0x00000] in <filename unknown>:0
      at ConVar.Server.Log (System.String strFilename, System.String strMessage) [0x00000] in <filename unknown>:0
      at Microsoft.Scripting.Interpreter.ActionCallInstruction`2[System.String,System.String].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <filename unknown>:0
      at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <filename unknown>:0
    there is also no crafted.txt
     
  5. Does the "logs" directory inside of oxide exist?
    Can you confirm that the path "C:\TCAFiles\Users\ChristianF\14256\server\my_server_identity\oxide\logs\" is valid?
    If the path is valid, does whatever user you are running the server under have the right to write to that location?
     
  6. Path is correct. Other Logs are there, too. oxide-logs and compiler.txt
    [DOUBLEPOST=1455198483][/DOUBLEPOST]I see, path is IP\server\logs for oxide-logs
    [DOUBLEPOST=1455199118][/DOUBLEPOST]I have placed a crafted.txt in the right folder, now it works.
     
  7. Alright. I'm pretty sure it's specific to your setup (I've reproduced the exact file path you specified and it worked).
    Oxide usually logs everything to IP/server/identity/oxide/logs, not IP/server/logs, where identity is the root directory for all plugins.
    I'm still not really sure how your setup is different from the standard one so that it doesn't work, though (why does it log to IP/server/logs, and why does it suddenly work when you create the text file?).
     
  8. No matter, issue that it works. anyhow.
     
  9. sqroot updated CraftLog with a new update entry:

    1.1.0

     
  10. sqroot updated CraftLog with a new update entry:

    1.1.1

     
  11. Hey sqroot, I love the plugin, thank you for your time. Any thoughts on adding a config to allow this to export to JSON/XML ? I don't want real-time writes to a database due to latency but I would love to easily parse this into a database on a fixed schedule to do some reporting on bad actors.
     
  12. Yeah, I've thought about this as well before, although I consider the logging format to be parsable enough.
    I wouldn't essentially integrate it into the plugin as doing actual analyzation of the log is, as you mentioned, not essentially something people need in real time during runtime (and it would require either parsing the log at runtime or logging the data in a more parseable format), but instead use a seperate script for analyzing the log format.
     
  13. can i make it only log certain items??
     
  14. Not right now, but it sounds like a good suggestion.
    I'll see if I can get around adding that later.
    [DOUBLEPOST=1455834093,1455812654][/DOUBLEPOST]
    Here's a tool to convert the log to JSON/XML/CSV/an SQLite3 DB.
    The tool also groups "started" and "cancelled" messages into a single one, telling you how many items were actually crafted, not how many were started and cancelled.

    Command line usage:
    clconv <format> <input> <output>
    Format is one of json/xml/csv/sqlite3 and the format to parse to.
    Input specifies the input log.
    Output specifies the output location.

    The source code can be found here:
    [Go] package main import ( "bufio" "database/sql" "encoding/csv" "encoding - Pastebin.com

    A build for Windows and x86-64 can be found here:
    clconv.exe

    To build the program yourself setup a Go workspace (install Go, create a workspace somewhere containing the directories "src", "pkg" and "bin", add the workspace path to your system path), call "go get github.com/mattn/go-sqlite3", paste the content of the pastebin to workspace/src/clconv/clconv.go and then use "go build clconv.go".
    You also need a gcc build for your architecture added to the PATH for compiling the sqlite C library with "go build". MinGW/MinGW64 is useful on windows in this regard.
     
    Last edited by a moderator: Feb 19, 2016
  15. Wow, thanks a ton sqroot that is very impressive! I already tested it on my logs and it works great. I appreciate you taking the time to well document how to use and compile it. If you ever need someone to help test anything you're doing let me know.

    If you are interested in any custom plugin work for hire let me know I have some specific challenges that other rust servers might not have that I think can be easily solved by some basic plugins.
     
  16. sqroot updated CraftLog with a new update entry:

    1.2.0

     
  17. misunderstood the whitelist. I thought it would filter out the items I dont wanna see in the log. Now only these items got logged. I change the code so it does filter them out. Maybe you should rename it or add a blacklist instead :).
     
  18. Why rename it? A whitelist is a whitelist and a blacklist is a blacklist, those are the formal terms.
    What's your use case that you need a blacklist instead of a whitelist? (I usually only add features when I can think of a good use case where the feature is very useful for most people and I couldn't come up with a good one for blacklists when I wrote this initially)
     
  19. I have a medieval server and want to log all crafts except the usual ones that only fill the log unnecessary like bows, arrows, campfire and wood storage boxes. The rest I want to log. Therefore I don't want to whitelist all possible items and all to come but instead blacklist/filter out the 4 named above or maybe one or two more in the future.
     
  20. sqroot updated CraftLog with a new update entry:

    1.3.0