Skip to content

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
<home>
├── conf
│ ├── ...
│ ├── log4j.properties
│ └── ...
├── core
├── data
├── logs
│ ├── martini-log.txt
│ ├── martini-log.txt.2018-04-24
│ └── martini-log.txt.2018-04-25
└── packages

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
log4j.appender.file=io.toro.martini.core.util.MartiniFileLogger
log4j.appender.file.File=${toroesb.home}/logs/martini-log.txt 
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.layout=org.apache.log4j.PatternLayout 
log4j.appender.file.layout.ConversionPattern=%d{dd/MM/yy HH:mm:ss.SSS} %-5p [%c{1}] %m%n

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
System Commands
head: Prints the head of a log on a specified date
logs: Download logs on a specified date, up to the present
tail: Prints the tail of a log on a specified date

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:

StompOverWebSocketPublishingAppender

This 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

APIResponseLogAppender

Martini's debugger needs this 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
# The maximum number of days before deleting the previous log files.
log4j.appender.file.MaxNumberOfDays=7
# Indicates whether the appender will archive all previous log files before
# deleting them after the configured maximum number of days has been reached.
log4j.appender.file.CompressBackups=true