diff --git a/README.md b/README.md index 7e9ab81..490f933 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,11 @@
-**SQLog** is a **Golang** library that leverages the power of **slog** to streamline log management in a simple and efficient way. +**SQLog** is a **Golang** library that simplifies log management using **slog**. **SQLog** offers a lightweight and reliable solution for logging, making it perfect for developers seeking a cost-effective, high-performance way to monitor their applications. -One of its key advantages is its integration with **SQLite**, an embedded database, meaning there's no need for an external database server setup. This reduces operational costs and drastically simplifies system maintenance, as everything runs **embedded**, without complex dependencies. +It integrates with **SQLite**, so no external database setup is required. This keeps operations simple and reduces costs, as everything runs **embedded**. -With **SQLog**, you get a lightweight and robust solution for securely logging and storing data. It's ideal for developers looking for a practical, cost-effective, and reliable way to monitor their applications, without sacrificing performance. -## Requirements - -The builtin SQLite storage uses the package `github.com/mattn/go-sqlite3`, which is a cgo package, so you need `gcc`. - -See the link for more details: [https://github.com/mattn/go-sqlite3?tab=readme-ov-file#installation](https://github.com/mattn/go-sqlite3?tab=readme-ov-file#installation) ## Usage @@ -24,8 +18,6 @@ Below is an example of using **SQLog** with the SQLite storage, with the interfa You can view the generated logs at `http://localhost:8080/logs/`. -> **Demo** You can see a [complete example in the demo directory](./demo/). - ```go import ( "log/slog" @@ -80,16 +72,19 @@ func main() { ## Demo -[SQLog-demo.webm](https://github.com/user-attachments/assets/046b65c9-dd36-4779-8b15-915be5f7e3f3) - -There is a test project in the [demo directory](./demo/). +You can view the current version of the SQLog demo at the links below: The demo project captures all mouse movements and sends them to the server, which logs the received parameters. -You can also view the current version of the SQLog demo at the links below: +- **Log generator**: https://sqlog-demo.onrender.com/ +- **SQLog UI** : https://sqlog-demo.onrender.com/logs/ + + > **IMPORTANT**! I am using the [free version of Render](https://docs.render.com/free), so there is no guarantee of service stability or availability. + +[SQLog-demo.webm](https://github.com/user-attachments/assets/046b65c9-dd36-4779-8b15-915be5f7e3f3) + +The source code is in the [demo directory](./demo/). -- Log generator (see console): https://sqlog-demo.onrender.com/ -- **SQLog** UI: https://sqlog-demo.onrender.com/logs/+ To combine multiple terms into a complex query, you can use any of the following case insensitive Boolean operators: +
+Operator | +Description | +Example | +
---|---|---|
AND |
+ + Intersection: both terms are in the selected events (if nothing is added, AND is taken by default) + | +authentication AND failure | +
OR |
+ Union: either term is contained in the selected events | +authentication OR password | +
+ You can combine text with wildcards to enhance your searches. +
+Wildcard | +Description | +
---|---|
? |
+
+ Match a single special character or space. For example, to search
+ for an attribute my_attribute with the value hello world , my_attribute:hello?world .
+ |
+
* |
+
+ Perform a multi-character wildcard search.
+
|
+
+ Note: Wildcards work as wildcards inside and outside of double quotes. For example,
+ "*test*"
and *test*
matches a log which has the string test
in its message.
+ You cand escape the wildcard with with the \
character (example "\*test\*"
).
+
Search syntax | +Description | +
---|---|
hello |
+ Searches only the log message for the term hello . |
+
hello* |
+ Searches all log attributes for strings that starts with hello . For example, hello_world . |
+
*world |
+ Searches all log attributes for strings that finishes with world . For example, hello_world . |
+
Search syntax | +Description | +
---|---|
"hello world" |
+ Searches only the log message for the exact term hello world . |
+
Search syntax | +Description | +
---|---|
hello world |
+
+ Is equivalent to hello AND world .
+ It searches only the log message for the terms hello and world .
+ |
+
"hello world" "i am here" |
+
+ It searches all log attributes for the terms hello world and i am here .
+ |
+
To search on a specific attribute, add :
to specify you are searching on an attribute.
+ For instance, if your attribute name is url and you want to filter on the
+ url value https://github.com/nidorx/sqlog
, enter: url:https://github.com/nidorx/sqlog
+
Search query | +Description | +
---|---|
http.url_details.path:"/api/v1/test" |
+
+ Searches all logs matching /api/v1/test in the attribute http.url_details.path .
+ |
+
http.url:/api-v1/* |
+
+ Searches all logs containing a value in http.url attribute that start with /api-v1/
+ |
+
http.status_code:[200 TO 299] http.url_details.path:/api-v1/* |
+
+ Searches all logs containing a http.status_code value between 200 and 299, and
+ containing a value in http.url_details.path attribute that start with
+ /api-v1/
+ |
+
+ You can use numerical operators (<
,>
, <=
, or >=
) to
+ perform a search.
+ For instance, retrieve all logs that have a response time over 100ms with: http.response_time:>100
+
+ You can search for numerical attribute within a specific range. For instance, retrieve all your 4xx errors with: http.status_code:[400 TO 499]
+