maxlog is a command-line tool that retrieves and displays logs from the Maximo Application Suite (MAS). It supports multiple operating modes and provides straightforward commands for inspection and troubleshooting.
go buildThis will generate the maxlog executable.
maxlog [action] [options]logs– Show container or pod logsinspect– Inspect pods or containersversion– Display the current versionhelp– Show help information
maxlog logs --tag=mytag --tail=100MAXLOG_MODE
Sets the operation mode (k8sfor Kubernetes,podfor Podman)MAXLOG_TAIL
Number of log lines to display (default: 40)MAXLOG_K8S_NAMESPACE
Namespace for Kubernetes logsMAXLOG_K8S_APPTYPE- optional
This is the pod selector for Kubernetes logs. The default value isall,ui,cron,mea,rpt,jms. This is only required in k8s mode.MAXLOG_CONTAINER
Container name in Podman modeMAXLOG_USE_NERDFONT- optional
With the values1ortrue, symbols can be activated via a NerdFont (see Nerd Fonts). This option is disabled by default.MAXLOG_FOCUS- optional
It hides all lines that do not contain the word. It is not case-sensitive.
#!/usr/bin/env bash
export MAXLOG_MODE="k8s"
export MAXLOG_TAIL="100"
export MAXLOG_K8S_NAMESPACE="mas-demo-manage"
export MAXLOG_K8S_APPTYPE="all"
export MAXLOG_USE_NERDFONT="true"After setting the mode and selector via environment variables, maxlog can be used without restrictions. See the section on environment variables for more information. Without Command, the logs command is used:
maxlogOnly debug information should be displayed and one tag highlighted:
maxlog logs focus=debug tag=ZZTESTThe flags tag and focus make the command logs unnecessary:
maxlog focus=debug tag=ZZTESTIn the Go programming language, the following command is generally executed within the cloned directory:
go buildThis will provide an example of cross-compiling a release:
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w"See the LICENSE file in the project.