From d01ef2363a2932806f5e7ff481ec68fda0cc2c8b Mon Sep 17 00:00:00 2001
From: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
Date: Fri, 12 Sep 2025 15:02:11 -0400
Subject: [PATCH] docs: structlog replacing loguru (#9791)
* initial-content
* config-dir-and-data-are-separate
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* code-review
* add-partial-for-locations
* use-windows-oss-path
* reorder
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---
.../docs/Components/components-processing.mdx | 8 +--
docs/docs/Concepts/concepts-flows.mdx | 15 ++---
docs/docs/Develop/logging.mdx | 60 +++++++++++++++----
docs/docs/Develop/memory.mdx | 10 ++--
docs/docs/_partial-config-dir-paths.mdx | 9 +++
docs/docs/_partial-db-dir-paths.mdx | 6 ++
6 files changed, 79 insertions(+), 29 deletions(-)
create mode 100644 docs/docs/_partial-config-dir-paths.mdx
create mode 100644 docs/docs/_partial-db-dir-paths.mdx
diff --git a/docs/docs/Components/components-processing.mdx b/docs/docs/Components/components-processing.mdx
index 63c867b279..d9d2282b7a 100644
--- a/docs/docs/Components/components-processing.mdx
+++ b/docs/docs/Components/components-processing.mdx
@@ -646,13 +646,13 @@ To configure the **Save File** component and use it in a flow, do the following:
The **File Name** parameter controls where the file is saved.
It can contain a file name or an entire file path:
- * **Default location**: If you only provide a file name, then the file is stored in `.langflow/data`.
+ * **Default location**: If you only provide a file name, then the file is stored in the Langflow data directory. For example,`~/Library/Caches/langflow/data` on macOS.
* **Subdirectory**: To store files in subdirectories, add the path to the **File Name** parameter.
- For example, `subdirectory/my_file` creates `my_file` in `.langflow/data/subdirectory`.
If a given subdirectory doesn't already exist, Langflow automatically creates it.
+ For example, `files/my_file` creates `my_file` in `/data/files`, and it creates the `files` subdirectory if it doesn't already exist.
- * **Absolute or relative path**: To store files elsewhere in your `.langflow` installation or the local file system, provide the absolute or relative path to the desired location.
+ * **Absolute or relative path**: To store files elsewhere in your environment or local file storage, provide the absolute or relative path to the desired location.
For example, `~/Desktop/my_file` saves `my_file` to the desktop.
Don't include an extension in the file name.
@@ -680,7 +680,7 @@ To configure the **Save File** component and use it in a flow, do the following:
For example:
```text
- DataFrame saved successfully as 'my_file.csv' at /Users/user.name/.langflow/data/my_file.csv
+ DataFrame saved successfully as 'my_file.csv' at /Users/user.name/Library/Caches/langflow/data/my_file.csv
```
If the **File Name** contains a subdirectory or other non-default path, this is reflected in the `Message` output.
diff --git a/docs/docs/Concepts/concepts-flows.mdx b/docs/docs/Concepts/concepts-flows.mdx
index 0b59b6a0c8..dda1708887 100644
--- a/docs/docs/Concepts/concepts-flows.mdx
+++ b/docs/docs/Concepts/concepts-flows.mdx
@@ -4,6 +4,8 @@ slug: /concepts-flows
---
import Icon from "@site/src/components/icon";
+import PartialConfigDirPaths from '@site/docs/_partial-config-dir-paths.mdx';
+import PartialDBDirPaths from '@site/docs/_partial-db-dir-paths.mdx';
A _flow_ is a functional representation of an application workflow.
Flows receive input, process it, and produce output.
@@ -105,16 +107,15 @@ To get back to the **Projects** page after editing a flow, click the project nam
## Flow storage and logs
-By default, flows and [flow logs](/logging) are stored on local disk at the following default locations:
+By default, flows and flow execution data are stored in a SQLite database at the following locations.
+
-- **macOS Desktop**: `/Users//.langflow/cache`
-- **Windows Desktop**: `C:\Users\\AppData\Roaming\com.Langflow\cache`
-- **OSS macOS/Windows/Linux/WSL (uv pip install)**: `/lib/python3.12/site-packages/langflow/cache`
-- **OSS macOS/Windows/Linux/WSL (git clone)**: `/src/backend/base/langflow/cache`
+The database storage location can be customized using the `LANGFLOW_CONFIG_DIR` and `LANGFLOW_SAVE_DB_IN_CONFIG_DIR` environment variables. The config directory can be customized with the `LANGFLOW_CONFIG_DIR` environment variable.
-The overall storage location can be customized with the `LANGFLOW_CONFIG_DIR` environment variable, and the flow log storage location can be customized separately with the `LANGFLOW_LOG_FILE` environment variable.
+Langflow logs are stored in the config directory specified in the `LANGFLOW_CONFIG_DIR` environment variable.
+
-For more information, see [Memory management options](/memory).
+For more information, see [Memory management options](/memory) and [Logging](/logging).
## See also
diff --git a/docs/docs/Develop/logging.mdx b/docs/docs/Develop/logging.mdx
index 4b7d68a67f..a90e62dc96 100644
--- a/docs/docs/Develop/logging.mdx
+++ b/docs/docs/Develop/logging.mdx
@@ -6,33 +6,30 @@ slug: /logging
import Icon from "@site/src/components/icon";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import PartialConfigDirPaths from '@site/docs/_partial-config-dir-paths.mdx';
This page provides information about Langflow logs, including logs for individual flows and the Langflow application itself.
-Langflow uses the `loguru` library for logging.
+Langflow uses the [structlog](https://www.structlog.org) 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
-The default logfile storage location depends on your operating system:
+Langflow logs are stored in the config directory specified in the `LANGFLOW_CONFIG_DIR` environment variable.
+
-- **macOS Desktop**:`/Users//.langflow/cache`
-- **Windows Desktop**:`C:\Users\\AppData\Roaming\com.Langflow\cache`
-- **OSS macOS/Windows/Linux/WSL (`uv pip install`)**: `/lib/python3.12/site-packages/langflow/cache`
-- **OSS macOS/Windows/Linux/WSL (`git clone`)**: `/src/backend/base/langflow/cache`
+To customize log storage, see [Configure log options](#configure-log-storage-options).
-To customize log storage, see [Configure log options](#configure-log-options).
-
-## Configure log options
+### Configure log storage options
Use [Langflow environment variables](/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:
-### Logging environment variables
-
| Variable | Format | Default | Description |
|----------|--------|---------|-------------|
| `LANGFLOW_LOG_LEVEL` | String | `ERROR` | Sets the log level as one of `DEBUG`, `ERROR`, `INFO`, `WARNING`, and `CRITICAL`. For example, `LANGFLOW_LOG_LEVEL=DEBUG`. |
@@ -43,8 +40,47 @@ The following environment variables are available to configure logging:
| `LANGFLOW_LOG_FORMAT` | String | Not set | Set the log format configuration. |
| `LANGFLOW_PRETTY_LOGS` | Boolean | True | Enable pretty log formatting with colors and rich console output. |
-A complete example `.env` file is available in the [Langflow repository](https://github.com/langflow-ai/langflow/blob/main/.env.example).
+## 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](#log-storage):
+
+
+
+
+ ```bash
+ cd /Users/**USERNAME**/Library/Caches/langflow
+ ```
+
+
+
+ ```cmd
+ cd C:\Users\**USERNAME**\AppData\Local\langflow\langflow\Cache
+ ```
+
+
+
+
+2. Tail the main log file:
+
+
+
+
+ ```bash
+ tail -f langflow.log
+ ```
+
+
+
+ ```cmd
+ Get-Content -Wait -Path 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.
diff --git a/docs/docs/Develop/memory.mdx b/docs/docs/Develop/memory.mdx
index 20039433d0..09ac004e06 100644
--- a/docs/docs/Develop/memory.mdx
+++ b/docs/docs/Develop/memory.mdx
@@ -3,6 +3,9 @@ title: Memory management options
slug: /memory
---
+import PartialConfigDirPaths from '@site/docs/_partial-config-dir-paths.mdx';
+import PartialDBDirPaths from '@site/docs/_partial-db-dir-paths.mdx';
+
Langflow provides flexible memory management options for storage and retrieval of data relevant to your flows and your Langflow server.
This includes essential Langflow database tables, file management, and caching, as well as chat memory.
@@ -11,12 +14,7 @@ This includes essential Langflow database tables, file management, and caching,
Langflow supports both local memory and external memory options.
Langflow's default storage option is a [SQLite](https://www.sqlite.org/) database stored in your system's cache directory.
-The default storage path depends on your operation system and installation method:
-
-- **macOS Desktop**: `/Users//.langflow/data/database.db`
-- **Windows Desktop**: `C:\Users\\AppData\Roaming\com.Langflow\data\langflow.db`
-- **OSS macOS/Windows/Linux/WSL (`uv pip install`)**: `/lib/python3.12/site-packages/langflow/langflow.db` (Python version may vary)
-- **OSS macOS/Windows/Linux/WSL (`git clone`)**: `/src/backend/base/langflow/langflow.db`
+
Alternatively, you can use an external PostgreSQL database for all of your Langflow storage.
You can also selectively use external storage for chat memory, separate from other Langflow storage.
diff --git a/docs/docs/_partial-config-dir-paths.mdx b/docs/docs/_partial-config-dir-paths.mdx
new file mode 100644
index 0000000000..77ade40df4
--- /dev/null
+++ b/docs/docs/_partial-config-dir-paths.mdx
@@ -0,0 +1,9 @@
+The default config directory location depends on your operating system and installation method:
+
+- **macOS Desktop**:`/Users//Library/Logs/com.Langflow`
+- **Windows Desktop**:`C:\Users\\AppData\Roaming\com.Langflow\cache`
+- **OSS macOS/Windows/Linux/WSL (`uv pip install`)**:
+ - **macOS**: `/Users//Library/Caches/langflow`
+ - **Linux**: `/home//.cache/langflow`
+ - **Windows**: `C:\Users\\AppData\Local\langflow\langflow\Cache`
+- **OSS macOS/Windows/Linux/WSL (`git clone`)**: `/src/backend/base/langflow/`
diff --git a/docs/docs/_partial-db-dir-paths.mdx b/docs/docs/_partial-db-dir-paths.mdx
new file mode 100644
index 0000000000..066c61732b
--- /dev/null
+++ b/docs/docs/_partial-db-dir-paths.mdx
@@ -0,0 +1,6 @@
+The default storage path depends on your operation system and installation method:
+
+- **macOS Desktop**: `/Users//.langflow/data/database.db`
+- **Windows Desktop**: `C:\Users\\AppData\Roaming\com.Langflow\data\langflow.db`
+- **OSS macOS/Windows/Linux/WSL (`uv pip install`)**: `/lib/python3.12/site-packages/langflow/langflow.db` (Python version may vary)
+- **OSS macOS/Windows/Linux/WSL (`git clone`)**: `/src/backend/base/langflow/langflow.db`
\ No newline at end of file