Trouble getting console output.

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Depth
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jun 28, 2017 11:43 pm
Contact:

Trouble getting console output.

Post 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.
Depth
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jun 28, 2017 11:43 pm
Contact:

Re: Trouble getting console output.

Post 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.
DustWolf
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Jul 25, 2018 9:17 pm
Contact:

Re: Trouble getting console output.

Post 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
Post Reply

Return to “Technical Help”