Skip to main content

Overview

Stencil embraces a comprehensive logging approach, offering autologging for all services and enforcing consistent log conventions through lints. This ensures that logging is not only a powerful debugging tool but also an integral part of maintaining code quality and consistency across the project.

Autologging for All Services

Autologging is seamlessly integrated into all Stencil services. This means that essential events and actions within each service are automatically logged, providing developers with valuable insights into the execution flow and potential issues.

Logs Defined with Proper Conventions

To maintain clarity and consistency in logs, Stencil follows well-defined conventions for log messages. These conventions make it easy to understand the context of log entries and facilitate effective log analysis.

Logs Enforced Through Lints

Logs are not just a feature; they are a part of the code quality standards. Stencil enforces logging practices through lints, ensuring that logs are appropriately placed and follow the defined conventions. This proactive approach contributes to a more maintainable and standardized codebase.

Places Where Logs Can Be Sent

Console Logs

Console logs serve as the immediate and direct output during development. Stencil makes effective use of console logs to provide real-time feedback on the application's behavior, making it easier for developers to monitor and debug.

Axiom Logs

Axiom, Stencil's internal logging service, is designed to handle more extensive and persistent log data. It acts as a centralized logging solution, collecting and storing logs for comprehensive analysis. Axiom provides a structured approach to log management, enabling efficient tracking of events and issues across services.

ELK Logs

Logs can be seamlessly integrated with the ELK (Elasticsearch, Logstash, and Kibana) stack, a powerful toolset for log storage and analysis. Stencil supports sending logs to the ELK stack, allowing for centralized log storage, advanced querying, and visualization through Kibana.

Getting Started with Logging

To make the most of Stencil's logging capabilities, developers should:

  1. Review Autogenerated Logs:

    • Explore autogenerated logs to gain insights into service behavior.
  2. Adhere to Log Conventions:

    • Follow the predefined log conventions to ensure consistency.
  3. Check Linting Output:

    • Pay attention to linting output to address any logging-related issues.
  4. Utilize Console Logs for Development:

    • Leverage console logs during development for immediate feedback.
  5. Explore Axiom and ELK Integration:

    • For more extensive log analysis, explore integration with Axiom or the ELK stack.