Martini Monitoring Logs
Martini logs various events during its runtime, providing valuable insights for debugging and tracing transactions.
Viewing Log Files
Martini stores its log files in the logs
directory within the application's home directory. Martini utilizes a customized FileAppender, similar to DailyRollingFileAppender
, for logging. The primary log file is named martini-log.txt
, with dated rolled-over log files. You can access these logs directly.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Viewing Log Messages
Martini provides several interfaces for viewing log messages.
Logs View
The Logs view displays the last n
log messages. From Martini Designer's Menu Bar, click on Martini
and choose Open Logs.
Console View
The Console view shows real-time application logs. It relies on WebSocket connection. Ensure StompOverWebSocketPublishingAppender
is enabled in log4j.properties
.
1 2 3 4 5 |
|
This view's toolbar is comprised of the following items:
Log Selector: Select which log to display based on the logs produced by the package or service to display on the console. All logs are display by default
Clear console button: Clears all log messages currently displayed in the Console view.
Application Logs Page
For Martini Server Runtime subscribers, log messages can be viewed through the Martini Server Runtime Admin web interface under Server Status
> Application Logs
.
View up to textbox: The maximum number of lines shown in the Logs view. It shows only the most recent n
lines where
n
is the configured maximum viewable lines.
Ascending checkbox: When checked, allows you to view the most recent logs at the top of the logs panel; otherwise, shows the most recent logs at the bottom of the panel.
Load button: When clicked, performs a hard refresh of the page. If you have modified the maximum number of viewable lines or the order of the logs, you need to click this button to propagate the changes.
Server time label: Displays the current time on the server.
Download button: Allows you to obtain a local copy of the logs printed on a specific date.
CLI Tool
The CLI tool offers commands for querying server logs.
Configuring Logging Service
1 2 3 4 |
|
Configure Martini's logging service via user interfaces or by editing log4j.properties
.
Via UI
Martini Designer Desktop Edition, Martini Designer Team Workspace, and Martini Server Runtime Edition Admin UI allow easy configuration of loggers. To add, edit, and delete a logger, click on the Martini's Menu Bar and choose Open Logs.
Via log4j.properties
For advanced configuration, directly edit the log4j.properties
file located in the conf
directory.
Via REST API
Martini provides REST
endpoints for retrieving log files and maintaining loggers. This API allows you to remotely do things such as:
- Get a list of allowable log levels
- Add or remove loggers
- Retrieve Martini logs
Required Appenders
Certain Martini components rely on pre-configured appenders:
The StompOverWebSocketPublishingAppender
publishes Martini's log messages to subscribers of the endpoint /topic/logs
over a web socket
connection. The following components need this appender to function properly:
- Martini Designer's Logs view
- Martini Designer's Console view
- Martini Server Runtime Admin UI's Application Logs page
Martini's debugger needs the APIResponseLogAppender
appender to function properly.
Backing up Log Files
Martini's MartiniFileLogger
backs up log files daily. You can configure it to compress backup files.
1 2 3 4 5 |
|