Closed Mattie112 closed 2 years ago
And just to confirm:
Adding the following:
args = append(args,
"--bind", server.BindIP,
"--port", strconv.Itoa(server.Port),
"--server-settings", config.SettingsFile,
"--rcon-port", strconv.Itoa(config.FactorioRconPort),
"--rcon-password", config.FactorioRconPass,
"--console-log", "/opt/factorio/console.log")
Does give me a nice log with only chats! Exactly what I want! (and yes I did get it to work building in WSL).
So really my question is: What are the current log file options? Are they correct / used?
Would it be OK if I submit a PR that adds a chat-log
config variable (optional). I think on startup we should clear this file just like the factorio-server-console.log
edit: If anyone wants to try this HARDCODED to /opt/factorio/console.log feel free to use: https://hub.docker.com/layers/190112090/mattie112/temp/factorio-server-manager/images/sha256-d9586a00ccead3f95ecd295dc798e6556312b3628f08c6e1616ad710dd76ffec?context=repo
(so it can be parsed a bit better in my discord bot)
If I manually start a server like:
bin\x64\factorio.exe --console-log console.log --start-server TEST
I get 2 files
factorio-current.log
andconsole.log
The
factorio-current.log
contains all gameplay related stuff (loading mods etc) small example:The file
console.log
contains:For my Discord bot I want to get chat/join/leave, however parsing the last line does not always work because if someone quits you get a lot of log entries in one go. It would be great if the console-log could be specified to go to an other file.
There might be an option https://github.com/OpenFactorioServerManager/factorio-server-manager/wiki/Installation-and-Usage#confjson but I tried all combinations but I could not get it to work. I can't find a good explanation on what it does.
For example, my conf.json contains:
But when I check the log I do not see this added to the start arguments:
Am I using it incorrectly? Or is this not implemented? I am on the devlop branch btw.
Perhaps around here if I understand the code correctly: https://github.com/OpenFactorioServerManager/factorio-server-manager/blob/develop/src/factorio/server.go#L250