mirror of
https://github.com/katanemo/plano.git
synced 2026-05-03 04:42:49 +02:00
add dynamic log config
This commit is contained in:
parent
f019f05738
commit
f04c0b7cdd
9 changed files with 634 additions and 5 deletions
76
docs/source/guides/observability/logging.rst
Normal file
76
docs/source/guides/observability/logging.rst
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
.. _logging:
|
||||
|
||||
Logging
|
||||
=======
|
||||
|
||||
Plano supports dynamic log level changes at runtime, allowing you to increase
|
||||
verbosity for debugging without restarting the service.
|
||||
|
||||
Setting the Log Level at Startup
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Set the ``LOG_LEVEL`` environment variable before starting Plano:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
LOG_LEVEL=debug planoai up config.yaml
|
||||
|
||||
This controls both the brightstaff service (``RUST_LOG``) and Envoy's WASM
|
||||
component log level.
|
||||
|
||||
Changing the Log Level at Runtime
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Use the ``planoai log-level`` command to change levels on a running instance:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Set both services to debug
|
||||
planoai log-level debug
|
||||
|
||||
# Set both services to info
|
||||
planoai log-level info
|
||||
|
||||
# Show current log levels
|
||||
planoai log-level --show
|
||||
|
||||
# For Docker-based instances
|
||||
planoai log-level debug --docker
|
||||
|
||||
The brightstaff service also accepts granular ``RUST_LOG``-style filters:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Debug for brightstaff crate only, info for everything else
|
||||
planoai log-level "brightstaff=debug,info"
|
||||
|
||||
Available log levels (from most to least verbose): ``trace``, ``debug``,
|
||||
``info``, ``warn``, ``error``.
|
||||
|
||||
Direct API Access
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can also change log levels directly via HTTP:
|
||||
|
||||
**Brightstaff** (port 9091, or 19091 in Docker mode):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Get current level
|
||||
curl http://localhost:9091/admin/log-level
|
||||
|
||||
# Set level
|
||||
curl -X PUT http://localhost:9091/admin/log-level -d "debug"
|
||||
|
||||
**Envoy** (port 9901, or 19901 in Docker mode):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# View all logger levels
|
||||
curl http://localhost:9901/logging
|
||||
|
||||
# Set all loggers to debug
|
||||
curl -X POST "http://localhost:9901/logging?level=debug"
|
||||
|
||||
# Set only WASM component to debug
|
||||
curl -X POST "http://localhost:9901/logging?wasm=debug"
|
||||
|
|
@ -9,3 +9,4 @@ Observability
|
|||
tracing
|
||||
monitoring
|
||||
access_logging
|
||||
logging
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue