Page 1 of 1

Trouble getting console output.

Posted: Fri Jun 30, 2017 1:05 am
by Depth
I'm trying to read what factorio writes to console so i can relay join/leave messages and the ingame chat to channel on discord via a bot made in c#.
The server is running on windows and I have had no luck redirecting the stdout of the server (I have code that works fine with other console programs just not factorio).

Has anyone had any success doing so with a factorio server on Windows or knows of another method that i can use to capture the console output? (Can't use the factorio log file as it doesn't log the chat and there is a delay between writes).
As far as i know rcon is useless to me also as it only responds to commands sent to it which will not provide me live chat updates.

Re: Trouble getting console output.

Posted: Sat Jul 01, 2017 1:33 am
by Depth
So i found a solution to my issue.
factorio-current.log is useless for getting chat output and i wasted too many hours trying to somehow get the standard output for the server.
However if you launch the server with the "--console-log <path>" argument you get a separate file which contains any console messages that appear on the server, chat messages included.

I still can't redirect the consoles standard output or input but that's less of an issue as I can use rcon for whatever input I need and can monitor the console.log for chat and factorio-current.log for anything else.

Just posting this here incase anyone else was looking for a solution to this problem as well.

Re: Trouble getting console output.

Posted: Wed Jul 25, 2018 9:27 pm
by DustWolf
Hey,

I know this is a bit of a necro, but since this thread helped me I suppose it can help someone else.

You can use Screen to send chat messages to the console of a running server.

LP,
Jure