main: Replace -debug with -log-level
Running crio with -debug is very verbose. Having more granularity on the log level can be useful when e.g. only looking for errors. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
5b2652c3e3
commit
a5e5ccb365
5 changed files with 19 additions and 13 deletions
|
@ -197,10 +197,6 @@ func main() {
|
||||||
Name: "conmon",
|
Name: "conmon",
|
||||||
Usage: "path to the conmon executable",
|
Usage: "path to the conmon executable",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
|
||||||
Name: "debug",
|
|
||||||
Usage: "enable debug output for logging",
|
|
||||||
},
|
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "listen",
|
Name: "listen",
|
||||||
Usage: "path to crio socket",
|
Usage: "path to crio socket",
|
||||||
|
@ -223,6 +219,11 @@ func main() {
|
||||||
Value: "text",
|
Value: "text",
|
||||||
Usage: "set the format used by logs ('text' (default), or 'json')",
|
Usage: "set the format used by logs ('text' (default), or 'json')",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "log-level",
|
||||||
|
Usage: "log messages above specified level: debug, info (default), warn, error, fatal or panic",
|
||||||
|
},
|
||||||
|
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "pause-command",
|
Name: "pause-command",
|
||||||
Usage: "name of the pause command in the pause image",
|
Usage: "name of the pause command in the pause image",
|
||||||
|
@ -361,8 +362,13 @@ func main() {
|
||||||
|
|
||||||
logrus.SetFormatter(cf)
|
logrus.SetFormatter(cf)
|
||||||
|
|
||||||
if c.GlobalBool("debug") {
|
if loglevel := c.GlobalString("log-level"); loglevel != "" {
|
||||||
logrus.SetLevel(logrus.DebugLevel)
|
level, err := logrus.ParseLevel(loglevel)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
logrus.SetLevel(level)
|
||||||
}
|
}
|
||||||
|
|
||||||
if path := c.GlobalString("log"); path != "" {
|
if path := c.GlobalString("log"); path != "" {
|
||||||
|
|
|
@ -13,13 +13,13 @@ crio - OCI Kubernetes Container Runtime daemon
|
||||||
[**--config**=[*value*]]
|
[**--config**=[*value*]]
|
||||||
[**--conmon**=[*value*]]
|
[**--conmon**=[*value*]]
|
||||||
[**--cpu-profile**=[*value*]]
|
[**--cpu-profile**=[*value*]]
|
||||||
[**--debug**]
|
|
||||||
[**--default-transport**=[*value*]]
|
[**--default-transport**=[*value*]]
|
||||||
[**--help**|**-h**]
|
[**--help**|**-h**]
|
||||||
[**--insecure-registry**=[*value*]]
|
[**--insecure-registry**=[*value*]]
|
||||||
[**--listen**=[*value*]]
|
[**--listen**=[*value*]]
|
||||||
[**--log**=[*value*]]
|
[**--log**=[*value*]]
|
||||||
[**--log-format value**]
|
[**--log-format value**]
|
||||||
|
[**--log-level value**]
|
||||||
[**--pause-command**=[*value*]]
|
[**--pause-command**=[*value*]]
|
||||||
[**--pause-image**=[*value*]]
|
[**--pause-image**=[*value*]]
|
||||||
[**--registry**=[*value*]]
|
[**--registry**=[*value*]]
|
||||||
|
@ -66,9 +66,6 @@ crio is meant to provide an integration path between OCI conformant runtimes and
|
||||||
**--cpu-profile**=""
|
**--cpu-profile**=""
|
||||||
set the CPU profile file path
|
set the CPU profile file path
|
||||||
|
|
||||||
**--debug**
|
|
||||||
Enable debug output for logging
|
|
||||||
|
|
||||||
**--default-transport**
|
**--default-transport**
|
||||||
A prefix to prepend to image names that can't be pulled as-is.
|
A prefix to prepend to image names that can't be pulled as-is.
|
||||||
|
|
||||||
|
@ -105,6 +102,9 @@ set the CPU profile file path
|
||||||
**--log-format**=""
|
**--log-format**=""
|
||||||
Set the format used by logs ('text' (default), or 'json') (default: "text")
|
Set the format used by logs ('text' (default), or 'json') (default: "text")
|
||||||
|
|
||||||
|
**--log-level**=""
|
||||||
|
log CRI-O messages above specified level: debug, info (default), warn, error, fatal or panic
|
||||||
|
|
||||||
**--log-size-max**=""
|
**--log-size-max**=""
|
||||||
Maximum log size in bytes for a container (default: -1 (no limit))
|
Maximum log size in bytes for a container (default: -1 (no limit))
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ Description=CRI-O daemon
|
||||||
Documentation=https://github.com/kubernetes-incubator/cri-o
|
Documentation=https://github.com/kubernetes-incubator/cri-o
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/bin/crio --runtime /bin/runc --log /root/crio.log --debug
|
ExecStart=/bin/crio --runtime /bin/runc --log /root/crio.log --log-level debug
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ function start_crio() {
|
||||||
fi
|
fi
|
||||||
${netfunc} $POD_CIDR
|
${netfunc} $POD_CIDR
|
||||||
|
|
||||||
"$CRIO_BINARY" --debug --config "$CRIO_CONFIG" & CRIO_PID=$!
|
"$CRIO_BINARY" --log-level debug --config "$CRIO_CONFIG" & CRIO_PID=$!
|
||||||
wait_until_reachable
|
wait_until_reachable
|
||||||
|
|
||||||
run crictl inspecti redis:alpine
|
run crictl inspecti redis:alpine
|
||||||
|
|
|
@ -163,7 +163,7 @@ Description=OCI-based implementation of Kubernetes Container Runtime Interface
|
||||||
Documentation=https://github.com/kubernetes-incubator/cri-o
|
Documentation=https://github.com/kubernetes-incubator/cri-o
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/crio --debug
|
ExecStart=/usr/local/bin/crio --log-level debug
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue