Skip to main content

Logs

This page provides information about Langflow logs, including logs for individual flows and the Langflow application itself.

Langflow uses the structlog library for logging.

The default logfile is named langflow.log. Langflow also produces logfiles for flows.

Log files are stored in JSON format with structured metadata.

Log storage

Langflow logs are stored in the config directory specified in the LANGFLOW_CONFIG_DIR environment variable.

The default config directory location depends on your operating system and installation method:

  • macOS Desktop:/Users/<username>/Library/Logs/com.Langflow
  • Windows Desktop:C:\Users\<username>\AppData\Roaming\com.Langflow\cache
  • OSS macOS/Windows/Linux/WSL (uv pip install):
    • macOS: /Users/<username>/Library/Caches/langflow
    • Linux: /home/<username>/.cache/langflow
    • Windows: C:\Users\<username>\AppData\Local\langflow\langflow\Cache
  • OSS macOS/Windows/Linux/WSL (git clone): <path_to_clone>/src/backend/base/langflow/

To customize log storage, see Configure log options.

Configure log storage options

Use Langflow environment variables to configure logging options in your Langflow .env file, and then start Langflow with uv run langflow run --env-file .env.

The following environment variables are available to configure logging:

VariableFormatDefaultDescription
LANGFLOW_LOG_LEVELStringERRORSets the log level as one of DEBUG, ERROR, INFO, WARNING, and CRITICAL. For example, LANGFLOW_LOG_LEVEL=DEBUG.
LANGFLOW_LOG_FILEStringNot setSets the log file storage location if you want to use a non-default location. For example, LANGFLOW_LOG_FILE=path/to/logfile.log. If this option isn't set, logs are written to stdout.
LANGFLOW_LOG_ENVStringdefaultControls how logs are formatted and displayed. container: JSON format for Docker/structured logging. container_csv: CSV format for data analysis. default or unset: Pretty, colorful format for development/reading using RichHandler.
LANGFLOW_LOG_ROTATIONString1 dayControls when the log file is rotated, either based on time or file size. Time-based rotation: "1 day", "12 hours", "1 week". Size-based rotation: "10 MB", "1 GB". Disable rotation: "None" (log files will grow without limit).
LANGFLOW_LOG_RETRIEVER_BUFFER_SIZEInteger10000Set the buffer size for log retrieval. Only used if LANGFLOW_ENABLE_LOG_RETRIEVAL is enabled.
LANGFLOW_LOG_FORMATStringNot setSet the log format configuration.
LANGFLOW_PRETTY_LOGSBooleanTrueEnable pretty log formatting with colors and rich console output.

View logs in real-time

To monitor Langflow logs as they are generated, you can use the tail -f command to follow the log file:

  1. Change to your Langflow config directory:


    _10
    cd /Users/**USERNAME**/Library/Caches/langflow

  2. Tail the main log file:


    _10
    tail -f langflow.log

    If you don't see new log entries, check that Langflow is running and generating logs. You can also check the terminal where you started Langflow to see if logs are being displayed there.

Flow and component logs

After you run a flow, you can inspect the logs for the each component and flow run. For example, you can inspect Message objects ingested and generated by Input and Output components.

View flow logs

In the visual editor, click Logs to view logs for the entire flow:

Logs pane

Then, click the cells in the inputs and outputs columns to inspect the Message objects. For example, the following Message data could be the output from a Chat Input component:


_12
"messages": [
_12
{
_12
"message": "What's the recommended way to install Docker on Mac M1?",
_12
"sender": "User",
_12
"sender_name": "User",
_12
"session_id": "Session Apr 21, 17:37:04",
_12
"stream_url": null,
_12
"component_id": "ChatInput-4WKag",
_12
"files": [],
_12
"type": "text"
_12
}
_12
],

In the case of Input/Output components, the original input might not be structured as a Message object. For example, a Language Model component might pass a raw text response to a Chat Output component that is then transformed into a Message object.

You can find .log files for flows at your Langflow installation's log storage location. For filepaths, see Log storage.

View chat logs

In the Playground, you can inspect the chat history for each chat session. For more information, see View chat history.

View output from a single component

When debugging issues with the format or content of a flow's output, it can help to inspect each component's output to determine where data is being lost or malformed.

To view the output produced by a single component during the most recent run, click Inspect output on the component in the visual editor.

Access Langflow Desktop logs

If you encounter issues with Langflow Desktop, you might need to access startup logs for debugging. Follow the steps for your operating system.

  1. Open Terminal and run:


    _10
    cd ~/Library/Logs/com.Langflow

  2. To open the folder and view the log files, run the command:


    _10
    open .

  3. Locate the langflow.log file.

You can use the log file to investigate the issue on your own, add context to a GitHub Issue, or send it to support for debugging assistance.

The log file is only created when Langflow Desktop runs. If you don't see a log file, try starting Langflow Desktop first, then check for the log file.

See also

Search