S
S
scar172021-07-04 00:14:49
JavaScript
scar17, 2021-07-04 00:14:49

How to make a logging system by date?

I have a bot on Heroku Node . js. I have an event for the appearance of a new message in which the message is stored in var and the discord bot sends it to the channel. But I need all messages to be written to files by date.
Approximately so that messages for 07/04/2021 are saved to the 04-07-2021.txt file created by the script and when the next day comes, the messages are written to the file 07/05/2021. All this should be organized on Heroku NodeJS with a connection on GitHub.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2021-07-04
@2ord

But I need all messages to be written to files by date.
Approximately so that messages for 07/04/2021 are saved to the 04-07-2021.txt file created by the script and when the next day comes, the messages are written to the file 07/05/2021.
It won't work on Heroku. Read https://help.heroku.com/K1PPS2WM/why-are-my-file-u...
Instead of files, use S3 or just a database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question