summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarri Devender Rao <devenrao@in.ibm.com>2017-12-12 03:32:32 -0600
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-01-22 19:07:57 +0000
commit41dbca81408b784c94c6ad180342873b314dcc89 (patch)
tree72707d5543384766d54f65f8e61427bab6fb68ec
parent3c7136f177769875cfb642720a83796e162d5e31 (diff)
downloadphosphor-dbus-interfaces-41dbca81408b784c94c6ad180342873b314dcc89.zip
phosphor-dbus-interfaces-41dbca81408b784c94c6ad180342873b314dcc89.tar.gz
Add README for logging
Resolves openbmc/openbmc#2691 Change-Id: I95d76f39a66b3d88af050584fde2ff277881c76a Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
-rw-r--r--xyz/openbmc_project/Logging/README.md66
1 files changed, 66 insertions, 0 deletions
diff --git a/xyz/openbmc_project/Logging/README.md b/xyz/openbmc_project/Logging/README.md
new file mode 100644
index 0000000..fc316d9
--- /dev/null
+++ b/xyz/openbmc_project/Logging/README.md
@@ -0,0 +1,66 @@
+# OpenBMC logging
+ * Provides a mechanism for logging events and errors to the journal.
+ * Creates error entry D-Bus objects when an error is reported/committed.
+ * Persists error entries across power off.
+
+## Error definitions
+### Generic error definitions
+* Generic errors used by applications are defined at
+ [phosphor-dbus-interfaces](https://github.com/openbmc/phosphor-dbus-interfaces)
+* Generic errors can be used by all the applications by including the generated
+ elog-errors.hpp header file.
+
+### Application error definitions
+* There are errors that are not generic and are very specific to the
+ application. Such errors are defined in the application that uses the error.
+* Refer to [openpower-debug-collector](https://github.com/openbmc/openpower-debug-collector)
+
+### Error YAML files
+ * Every error defined will have an error YAML file and a corresponding error
+ metadata YAML file.
+ * The error YAML file contains the error name and a one-line description of the error.
+ An example of an error YAML file can be found [here](https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Common/File.errors.yaml).
+ * The error metadata YAML file captures required data. The format of the data is defined in the error metadata file.
+ An example of an error metadata YAML file can be found [here](https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Common/File.metadata.yaml)
+
+## Logging to journal
+ * Applications can log debug/error information to the journal using
+ the **log** API
+ - Refer to [log.hpp](https://github.com/openbmc/phosphor-logging/blob/master/phosphor-logging/log.hpp)
+ * Applications can commit errors to the journal using the **report** or
+ **commit** API
+ - Refer to [elog.hpp](https://github.com/openbmc/phosphor-logging/blob/master/phosphor-logging/elog.hpp)
+ - Logging entry D-Bus objects are created for the committed errors.
+
+## Delete All interface
+* Use the [DeleteAll.interface.yaml](https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Collection/DeleteAll.interface.yaml)
+ for deleting all the logging entries.
+
+
+## REST commands
+### Logging in
+ * Before you can do anything, you need to first login.
+```
+$export bmc=xx.xx.xx.xx
+$curl -c cjar -b cjar -k -X POST -H "Content-Type: application/json" -d '{"data": [ "root", "<root password>" ] }' https://{$bmc}/login
+```
+
+### List logging child objects recursively
+```
+$curl -c cjar -b cjar -k https://${bmc}/xyz/openbmc_project/logging/list
+```
+
+### List logging attributes of child objects recursively
+```
+$curl -c cjar -b cjar -s -k -H 'Content-Type: application/json'; -d '{"data" : []}' -X GET https://${bmc}/xyz/openbmc_project/logging/enumerate
+```
+
+### Delete logging entries
+```
+$curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d '{"data": []}' https://${bmc}/xyz/openbmc_project/logging/entry/<entry num>/action/Delete
+```
+
+### Delete all logging entries
+```
+$curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST https://${bmc}/xyz/openbmc_project/logging/action/DeleteAll -d "{\"data\": [] }"
+```
OpenPOWER on IntegriCloud