How can I load the previous logs from a console.log without restarting the bot?


#1

So, my bot is up 24/7, I want to continue seeing the logs even after I’ve restarted my browser. I can’t node the bot as then the bot will run the codes twice.

How can I load the console to get the logs without shutting down the bot - which I am not able to do for some reason.

Thanks,


#2

Hey @zApexio, welcome to the Glitch forum!

The console logs in Glitch are ephemeral - they’re sent using a websocket, and once they’re sent, they’re gone. What you could do for any console.log() statements you’re using is to log them to a file in your project instead of (or in addition to) logging them to the console.

As far as stopping your bot, that’s the way Glitch is designed - as long as it’s awake a Glitch project is intended to run constantly. If you want to stop your bot from responding to commands, the easiest thing to do might be to comment out your client.login() command (or its corollary, if you’re using something other than discord.js).

Other bot authors might have other approaches to any of this as well.


Losing access to logs and errors for a discord bot due to the console automatically starting up the bot
#3

Alright, but how can I load the console logs of the bot after I had restarted my browser or device? I need to know as if I node it myself to get the console logs, the bot will respond twice due to it already being up.
So how can I get the console logs without noding it myself?

Thanks,