Skip to main content
This covers effective debugging methods using Naite.

What is Naite?

Naite is Sonamu’s test-dedicated logging system that collects and analyzes all logs generated during test execution. Key features:
  • Log isolation per test
  • Key-value based log storage
  • Powerful query capabilities
  • Visualization with Naite Viewer

Basic Usage

1. Recording Logs

2. Retrieving Logs

When a test fails, you can check the logs to identify the problem:

Debugging Patterns

API Request/Response Tracking

Database Query Tracking

Business Logic Flow Tracking

Log Key Naming Conventions

Designing keys with a hierarchical structure makes querying easier later:
Recommended pattern:

Conditional Logging

Activate logging only when debugging is needed:

Using Naite in Models

You can log with Naite in business logic:
Check in tests:

Log Queries

Naite provides powerful query capabilities:

NaiteQuery Methods

Naite.get() returns a NaiteQuery object:

Using Naite Viewer

Visualize logs with Naite Viewer after running tests:
Viewer features:
  • Filter logs by test
  • Key-based search
  • Timeline view
  • Export logs

Debugging Workflow

1. When Tests Fail

2. Log Analysis

3. Reproducing Specific Scenarios

Performance Debugging

Add timestamps to logs for performance analysis:

Cautions

1. Do Not Use in Production Code

2. Be Careful with Sensitive Information

3. Avoid Excessive Logging