Multiline logs
Multiline logs are log messages that are made of multiple lines. You can upload and manage multiline logs in Site24x7. Learn more about log management with Site24x7.
Getting started
- Log in to your Site24x7 account.
- Download and install the Site24x7 Server Monitoring agent (Windows | Linux).
- Go to Admin > AppLogs > Log Profile and Add Log Profile.
All you have to do is add <NewLine> in your log pattern every time you add a new line to your log. That way, the Site24x7 agent can parse the multiline log correctly.
Example
Let's consider the following multiline log:
getDatabaseConnection DEBUG:
JDBC URL: jdbc:mysql
Oct 30, 2018 12:27:24 AM com.blackstar.database.DatabaseUtils
getDatabase DEBUG:
Uncaught errors Error: Callback was already called
Oct 30, 2018 12:30:24 AM com.blackstar.database.DatabaseUtils
getTable DEBUG:
Table: Applog Table
Oct 30, 2018 12:35:24 AM com.blackstar.database.DatabaseUtils
getTable DEBUG:
Uncaught errors Error: Callback was already called.
at
/home/local/domain/user/Downloads/Postman/app/resources/app/node_modules/waterline/node_modules/async/dist/async.js:844:36
If you want to create a new log type based on a multiline log like the one above, you need to break up the log using <NewLine>. Here's an example using the multiline log above:
- Oct 30, 2018 12:26:24 AM com.blackstar.database.DatabaseUtils<NewLine>getDatabaseConnection DEBUG:<NewLine>JDBC URL: jdbc:mysql
- Oct 30, 2018 12:27:24 AM com.blackstar.database.DatabaseUtils<NewLine>getDatabase DEBUG:<NewLine>Uncaught errors Error: Callback was already called
- Oct 30, 2018 12:30:24 AM com.blackstar.database.DatabaseUtils<NewLine>getTable DEBUG:<NewLine>Table: Applog Table
- Oct 30, 2018 12:35:24 AM com.blackstar.database.DatabaseUtils<NewLine>getTable DEBUG:<NewLine>Uncaught errors Error: Callback was already called.<NewLine> at /home/local/domain/user/Downloads/Postman/app/resources/app/node_modules/waterline/node_modules/async/dist/async.js:844:36
Log pattern:
Aside from adding <NewLine> to break up the multiline log, you also need to enter a log pattern while creating a new log type. This is how you should enter the log pattern for the sample multiline log above.