You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/04/25 11:12:48 UTC
[GitHub] [camel-k] Gre8t commented on a diff in pull request #3231: added logging traits documentation.
Gre8t commented on code in PR #3231:
URL: https://github.com/apache/camel-k/pull/3231#discussion_r857514475
##########
examples/traits/logging/README.md:
##########
@@ -0,0 +1,45 @@
+# Logging Trait
+
+This type of trait tells us what is going on in a running integration pod. It does this by printing logs out to the standard output.
+
+Logs are enabled by default on an integration. Just run this example:
+
+ $kamel run logging.java
+
+ $kamel logs logging
+
+Or you can instead get the pod name and print its logs using kubectl:
+
+ $kubectl get pods
+
+ $kubecttl logs <pod name>
+
+You can configure the log output with the `logging traits` flag:
+
+Property | Type | Description
+---|---|---
+logging.enabled | boolean| We can set to false to disable logging
+logging.color | boolean| makes logging output colorful. This makes skimming through the logs easier.
+logging.json | boolean | Makes logs output to be in json format. We can use tools like `jq` to manipulate output.
+logging.json-pretty-print | boolean | It's like using an in built `jq` to print our json output.
+logging.level | string | This is just a verbosity level settings. We can just use `info`
+
+for more traits options see this [Link.](https://camel.apache.org/camel-k/next/traits/logging.html).
+
+manual log setting example using `logging trait`:
+
+ $kamel run ./logging.java --trait logging.enabled=true --trait logging.json=true --trait logging.level=info
+
+The output of this result would give this:
+- Logging would be enabled, but there would be no colors for easy skimming.
+- You would need to use your own jq to pretty print and parse the json output.
+
+**Image example**
+
Review Comment:
Ok, would do that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org