E
E
Egor Petrov2015-10-01 14:41:28
PHP
Egor Petrov, 2015-10-01 14:41:28

How can I save logs and, if possible, view them?

I googled superficially, but did not find an answer right away. Advise some tool for saving logs, or tell me what you need to write yourself.
The current situation: the load is growing, logs are written to text files, collecting information on questionable cases is becoming more tedious, hard drive space is running out more often and faster.
I would like to move logging to a separate machine, be able to save information about events of different types with different information, and of course, view this information without experiencing sharp pain. For example, if an api request was made 200 times and each time the response "wait a bit, the result is not ready" was returned, then this could be seen as one collapsed event. But the ability to view at the moment is not yet a prerequisite, just a Wishlist.
PS: We use postgresql as the base. PHP language.
PPS: Cloud logging is not suitable.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Artem Klimenko, 2015-10-01
@aklim007

https://getsentry.com/welcome/ - a chic high-level solution, but in my opinion it is not intended for logging everything at once, so that later you can decide what needs to be done, but rather log errors there, events defined by you, etc. (it is also provided as a service, you can also deploy it on your server)
For more general cases, it might be worth looking in the direction of logstash.
Well, get acquainted with such a thing as https://ru.wikipedia.org/wiki/Syslog

M
Maxim Smirnov, 2015-10-01
@MaxiStyle

1. Logs should be written to text files so as not to create a load on the application itself. Saving logs to the database (or somewhere else) is an extra burden.
2. Log only the information you need. You must really understand why you need gigabytes of information per day.
3. Classify log files: critical errors / debug / query log or database errors / application errors.
4. Google the log parser, not the way to save logs.
5. Set up logrotate correctly so that the place does not get clogged.

M
Max, 2015-10-01
@MaxDukov

see ELK. cool stuff.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question