So, my discord bot is logging every message from a server, I want to see these logs, but whenever I get into the console after a reload or a browser restart. After this has happened and I get back into the console. The bot starts up, but wont give me the console logs. If I node it, the code runs twice. How can I get the console logs without using node?
Losing access to logs and errors for a discord bot due to the console automatically starting up the bot
Hi @zApexio, unless I’m misunderstanding what you’re looking for, I believe I gave you the best answer for this in your other thread: How can I load the previous logs from a console.log without restarting the bot?
In short, you can’t load old log messages; once they’re sent, they’re gone. You’ll need to log the information you want to be able to access later in some persistent way - logging to a file is kind of the default, but you could also send them to a 3rd party logging service, or log them in a database. Then when you come back to your bot and want to review those logs you’ll open the file you’re logging to (or the service or database you’re sending them to).
It’s always important to make sure you’re never logging anything private (like your bot’s key, or your bot’s users’ personal details like email addresses or the like). That’s even more important if you’re logging to a file.
Yeah, you’re misunderstanding me right now. The problem right now isn’t old logs. It’s that I lose the ability to receive the logs after a refresh.
I am just asking how I can receive the logs and errors again.
The only way I know of is using the node, but if I node the bot, the bot will run the codes twice.
So I just need a way to receive logs, not load old logs right now.
Can you share your project name so we can take a look? Since your bot is always running, when you open the project in the editor and open the logs pane you should see the current logs, just like you expect, so if you’re not then I’d like to take a closer look.
A bot requested by a YouTuber/friend of me.
Oh, I didn’t realize about those logs panels. I thought I needed the console to view it. Although, I still kind of want to be able to view it in the console. But at least the problem with the logs, but the console issue.
Aha! Sometimes it’s easy to forget the stuff that seems obvious. Sorry for the confusion!
Right now (aside from mechanisms like I mentioned earlier) the Logs pane is the only place to see the logs. You might be interested in showing your support for one or more of the feature ideas around logs: https://support.glitch.com/search?q=logs%20category%3A7