Logging to Console
Overview
Console logging is a fundamental debugging and monitoring technique that allows you to write custom messages directly to the console output during workflow and service execution. This provides immediate visibility into application flow, variable states, and error conditions, making it an essential tool for development and troubleshooting.
What You Will Learn
- How to implement logging functions to display output in the Console view
- How to access and open the Console view in Martini Designer
- How to use Console view toolbar controls for filtering and managing log display
- How to use Console view context menu options including AI-powered log analysis
- How to read and interpret console log output effectively
- Best practices for managing console sessions and analyzing logs
When To Use This
Console logging is most useful during development, where immediate feedback helps you understand how your application behaves as it runs.
- Real-time Debugging: Observe how your code executes and identify logic errors
- Data Inspection: Inspect variable values and track data transformations
- Flow Verification: Confirm that your workflow follows the expected execution path
Prerequisites
- Martini Designer installed and running
- A Martini Package to work in
- Basic knowledge of Workflow Key Concepts and/or Services
- A Workflow or Service as your container for logging functions
Getting Started With Logging To Console
Before you can view and monitor logs in the console, you need to add logging functions to your workflows and services. Follow these step-by-step instructions to implement logging and start seeing output in the Console view.
- Choose the right logger function for your need from the Available Logger Functions
- Add a logger function node or step to your workflow or service (see Logging in Workflows and Services for details)
- Run the workflow or service
- View your log output in the Console view (see Viewing Console Output)
Example Console Output:
1 2 3 | |
Viewing Console Output
The Console view provides real-time monitoring of your application logs within Martini Designer, giving you immediate visibility into your logging functions as they execute.
Console View Overview
The Console view is an essential tool for monitoring application logs in real-time during development and testing. Unlike static log files, it streams log messages directly as they occur, providing instant feedback on your application's behavior.
Key Features:
- Real-time Log Streaming: See log messages immediately as your workflows and services execute
- Automatic Display: Opens automatically during startup
- Historical Access: View logs from earlier sessions without manual refresh
- Integrated Experience: Seamlessly integrated into Martini Designer for efficient debugging
Accessing the Console View
The Console view should appear at the bottom of Martini Designer by default. If it’s not visible, you can open it as follows:
- Go to the Martini Designer Menu Bar
- Click View
- Select Console
Expected result: The Console view appears at the bottom panel of your Martini Designer interface, ready to display log output from your applications.
Console Quick Access
Use the Toggle Bottom Panel button in the bottom-right corner of Martini Designer to instantly show or hide the console and other bottom panel views. You can also assign a keyboard shortcut for even faster access via the Keyboard Shortcuts settings.
Console View Toolbar
The Console view toolbar provides essential controls for filtering, managing, and controlling your log stream display.
| Control | Description | Use Case |
|---|---|---|
| Log Type Dropdown | Filter log messages by severity level | Switch between All, Errors, Warnings, or Info to focus on specific message types |
| Running Programs Dropdown | Select which program's logs to view | Choose between Martini Runtime logs, specific workflow logs, or service logs currently executing |
| Clear Console Button | Removes all current log messages from view | Clean the display for focused debugging of new executions |
| Clear All Debug Sessions Button | Closes Console views for terminated instances | Clean up multiple console sessions after testing different programs |
Console View Context Menu
Right-click anywhere within the Console view canvas to access additional log management and analysis options through the context menu.
| Menu Item | Description |
|---|---|
| Copy | Copies the selected log entry to the clipboard for sharing or reporting |
| Select All | Selects all visible log entries in the current log session |
| Collapse All | Collapses any expanded log entries to reduce visual clutter |
| Clear Console | Removes all log messages from the current log session |
| Ask AI | Sends selected console lines to an AI agent for contextual analysis (responses appear in the AI Chat view) |
Console Logging Best Practices
Optimize your console viewing experience and log management for effective debugging and monitoring.
Console View Management Best Practices
Organize and filter console output effectively for focused debugging sessions.
Console View Organization:
- Use Log Type Dropdown to filter by severity level during focused debugging sessions
- Select specific Log Session to isolate logs from the component you're debugging
- Use Clear Console between test runs to avoid confusion with previous executions
- Keep Console View visible during development for immediate feedback
Console Log Analysis Best Practices
Analyze console output effectively to identify issues and understand application behavior.
Reading and Interpreting Console Output:
- Review timestamps to understand execution order and performance timing
- Use log levels (
ERROR,WARN,INFO,DEBUG) to prioritize which messages need attention - Identify repeated messages that may indicate loops, retries, or unstable states
- Correlate console logs with workflow/service execution to track application flow
AI Assistance
For complex or unclear log sequences, you can use Ask AI for assistance. See Console View Context Menu to learn how to trigger it.
Troubleshooting Logger Function Issues
| Problem | Detection | Cause | Fix |
|---|---|---|---|
| Debug messages not appearing | Expected debug logs don't show in console | Debug level disabled for logger | Enable debug logging in Log Level Configuration |
Helpful Resources
- Logging in Workflows and Services - Comprehensive guide to adding logger functions to workflows and services
- Log Files In Martini - Complete guide to log file management, persistence, and configuration
- Log Levels Configuration - Comprehensive guide to log levels and advanced logging configuration
- Server Admin UI Logs - Production log management and monitoring
- Community Q&A: Martini Community
Have a question about logging? Post or search it here.