<@U0A71G31CDV> I see the logs in the file system f...
# questions-and-troubleshooting
s
@Rocky I see the logs in the file system for starrocks, however when I remove LOG_CONSOLE to false, it is forwarding logs to data dog but not showing up in file system. How can I make sure the logs gets forwarded to datadlog and I can also see the logs in the file system .?
r
In StarRocks, logging is currently designed as an either/or configuration. By default, StarRocks does not support "dual logging" (sending logs to both the console and the file system simultaneously) via a single toggle. Here is how the
LOG_CONSOLE
(or
sys_log_to_console
) parameter works: *
LOG_CONSOLE=1
(or
true
)
: Logs are sent to the console (stdout/stderr) instead of the file system. This is why you see them in Datadog (which collects stdout) but they disappear from your
/log
directory. *
LOG_CONSOLE=0
(or
false
)
: Logs are written to the file system (e.g.,
fe.log
,
<http://be.INFO|be.INFO>
) but are not printed to the console. How to get logs in both Datadog and the File System To have logs in both places, you should configure StarRocks to write to the file system and then tell the Datadog Agent to collect those files directly. 1. Configure StarRocks to write to Files Set your environment variable or configuration to: *
LOG_CONSOLE=0
(or remove the variable, as
false
is the default). * Verify that logs are now appearing in
/opt/starrocks/fe/log/
or
/opt/starrocks/be/log/
. 2. Configure Datadog to tail the Log Files Since logs are no longer going to stdout, Datadog won't see them automatically via the container's standard output. You must point Datadog to the specific file paths. If you are using Kubernetes: Add the following annotations to your StarRocks FE/BE Pods (or in the
podAnnotations
section of your Helm chart/Operator CRD):
Copy code
yaml
annotations:
  <http://ad.datadoghq.com/<CONTAINER_NAME>.logs|ad.datadoghq.com/<CONTAINER_NAME>.logs>: |
    [{
      "source": "starrocks",
      "service": "starrocks",
      "path": "/opt/starrocks/fe/log/fe.log" 
    }]
_(Replace
<CONTAINER_NAME>
with
fe
or
be
and adjust the
path
accordingly.)_ Note on Persistance: For Datadog to read these files in a Kubernetes environment, the log directory usually needs to be on a persistent volume or a volume shared with the node, so the Datadog Agent (running as a DaemonSet) can access the path. Summary * Console Mode: Logs → Console (Datadog picks up) | No File. * File Mode: Logs → File system | No Console. * Recommendation: Use File Mode (
LOG_CONSOLE=0
) and configure the Datadog Agent's "Log Collection from Files" feature to tail the StarRocks' log directory.