DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.22k stars 2.04k forks source link

Output to log #713

Open scarecr0w12 opened 6 years ago

scarecr0w12 commented 6 years ago

Is there any way we can get the console output logged to a file instead of simply adding '> log_out.log' to the end of my command, as i would still like access to the bots commands.

bdfoster commented 6 years ago

You can use tee in Linux, I believe.

scarecr0w12 commented 6 years ago

Well i was going to use pm2 and just launch as a node, bypasssing the .sh file. but the way it logs things gets all jumbled due to formatting. Would be nice ot see the system work a little more seemlessly with pm2 from a management stand point if running multi instances

bdfoster commented 6 years ago

The .sh file doesn't do anything other than run the .js file. But the reason why it's causing that issue is because it essentially deletes the line and writes a new one (unless it's incrementing the period). While not ideal for your situation, this is a relatively easy feature to add (maybe as a command line option) to either not delete the line and just append, or not write a new line in the first place (unless incrementing the period). You should open a new issue for this, but it's a good first issue for someone.

KryptoNova commented 6 years ago

I just use screen. Then when disconnecting from the ssh session, Zenbot continues to run. I am not sure if the goal is to log the output or just to be able to review the output to the screen. Using screen will satisfy the latter.

scarecr0w12 commented 6 years ago

I've been utilizing screen, im more wanting to be able to not only still run commands, but log output so i can give it to the people im working with to show them the bots work thus far.

bdfoster commented 6 years ago

I just use the database for those kinds of things. It's easy enough to query, I use a GUI like Studio 3T for convenience but the normal mongo shell works too.

rondijkstra commented 6 years ago

@bdfoster Does a tool like Studio 3T show all activity, including responses? I'm looking for a way to debug zenbot at the point where it should send messages to my discord-webhook. :D What's a good start with the mongo shell? (how to..)

JensvdHeydt commented 6 years ago

Just a reminder: There's a preconfigured adminmongo configuration part in the docker-compose file. AdminMongo is a web UI für MongoDB :)