Prism
v0.1.9rc2
v0.1.9rc2
  • 👋Welcome to Prism!
  • Getting Started
    • Installation
    • Creating your first project
    • Why Prism?
  • Fundamentals
    • Tasks
      • tasks
      • hooks
        • hooks.sql
        • hooks.spark
        • hooks.dbt_ref
    • Targets
      • Multiple targets
    • Config files
      • prism_project.py
        • RUN_ID / SLUG
        • SYS_PATH_CONF
        • THREADS
        • PROFILE_YML_PATH / PROFILE
        • PRISM_LOGGER
        • TRIGGERS_YML_PATH / TRIGGERS
      • Profile YML
      • Triggers YML
    • Jinja
      • __file__ and Path
      • prism_project
      • wkdir
      • parent_dir
      • concat
      • env
  • Adapters
    • Overview
    • sql
      • BigQuery
      • Postgres
      • Redshift
      • Snowflake
      • Trino
    • PySpark
    • dbt
  • Agents
    • Overview
    • Docker
    • EC2
  • CLI
    • Command Line Interface
    • init
    • compile
    • connect
    • create
      • agent
      • task
      • trigger
    • graph
    • run
    • spark-submit
    • agent
      • apply
      • run
      • build
      • delete
  • Advanced features
    • Concurrency
    • Logging
    • Triggers
    • Retries
    • Python Client
  • API Reference
    • prism.task.PrismTask
    • @task(...)
    • @target(...)
    • @target_iterator(...)
    • tasks.ref(...)
    • hooks.sql(...)
    • hooks.dbt_ref(...)
  • Use Cases
    • Analytics on top of dbt
    • Machine Learning
  • Wiki
    • DAGs
Powered by GitBook
On this page
  • Overview
  • Customizing logs
  1. Advanced features

Logging

PreviousConcurrencyNextTriggers

Last updated 1 year ago

Overview

Prism operates under the philosophy that logs should contain useful, diagnostic information about the project without overwhelming the reader.

Prism uses and extends Python’s builtin module to perform system logging. Whenever you run a project, Prism automatically logs events for parsing the configuration files, compiling the tasks and creating the DAG, and executing the tasks, etc. These events are color-coded to enhance readability. No configuration is needed to enable Prism logging.

Customizing logs

The logger is the entry point into Prism's logging system. If you want to log custom events in your project, you can do so with this variable:

# modules/task_with_logging.py

import prism_project
from prism_project import PRISM_LOGGER
import prism.task

class TaskWithLogging(prism.task.PrismTask):
    
    def run(self, tasks, hooks):
        PRISM_LOGGER.info("This is an example log message!")
        return ...

Logs are automatically saved to logs.log in the base project folder.

Note that you can specify the default log level to show using the command-line interface. See the for more information.

logging
PRISM_LOGGER
CLI section