ChrisLOG
Lightweight real-time log collection and viewing tool supports HTTP JSON, Syslog, and GELF log access, and provides SQLite persistence, full-text search, filtering and retention strategies.
ChrisLOG is a lightweight log aggregation and real-time viewing tool. It can receive logs from HTTP, Syslog, GELF and other sources, save the logs in the built-in SQLite database, and provide real-time viewing, search, filtering and cleaning capabilities through Web pages. It is suitable for temporarily troubleshooting service problems, centrally viewing logs of multiple devices or applications, verifying log push configurations, and quickly building a small log viewing portal when complex components such as Elasticsearch, Kafka, and Loki are not present. ##Main functions - Real-time log viewing: A new log will automatically appear on the Web page after it is written. - Multi-source access: Support HTTP JSON, Syslog UDP, Syslog TCP, GELF UDP. - Search and filtering: Support keyword, regular, log level, source, label, and time range filtering. - Local persistence: The logs are saved in the SQLite database and will not be lost after the application is restarted. - Automatic retention policy: The log is retained for 30 days by default, which can be adjusted through environmental variables. ##How to use the page After entering the web page, you can see the log list and the top toolbar. Common operations: - Search box: Enter keywords to search for log content. - Search: Perform a search. - `pause`: Pause or resume real-time refreshing. - `clear`: Clear the logs in the current database. - `level`: Filter by log level, such as `info`,`warning`,`error`. - `source`: Filter by source, such as `http`,`syslog`,`gel`. - `tag`: Filter by application or component label. - `from `/`to`: Filter by time range. Click on a certain line of the log to expand and view the original log content and more fields. ##Push logs via HTTP HTTP is the easiest way to access it. Send JSON to the `/api/ingest `of the application domain name to write the log. Example: ```bash curl-X POST https://your app domain name/api/ingest\ -H "Content-Type: application/json" \ -d '{ "host": "web01", "level": "error", "tag": "nginx", "message": "upstream connection failed" }' ``` Common fields: | field| required| description| | --- | --- | --- | | `message`|is| Log body. You can also use msg or short_message. | | `host`|no| Log source host. You can also use `hostname`. | | `level`|no| Log levels, such as `info`,`warning`,`error`. You can also use severity. | | `tag`|no| Name of the application, service, or component. You can also use `app` and `application`. | | `facility`|no| Syslog facility。| | `timestamp`|no| Unix timestamp, supporting seconds or milliseconds. Use the receive time when it is null. | Successful writing will return: ```json {"ok":true} ``` ##Access through Syslog ChrisLOG supports Syslog UDP and TCP, and the port is both `514`. You can test UDP with 'logger' on Linux/macOS: ```bash logger-n Your application domain name-P514--udp "hello from syslog" ``` TCP testing can use `nc`: ```bash echo "<14>$(date '+%b %d %H:%M:%S') web01 app: hello from syslog tcp" \ | nc Your application domain name 514 ``` After connecting, you can filter `source` to `syslog` on the page to view relevant logs.

