# Configure XWiki Logging

**URL:** <https://forum.xwiki.org/t/configure-xwiki-logging/15442>\
**Category:** Help / Discuss\
**Tags:** logging\
**Created:** [August 30, 2024, 2:25pm UTC](https://forum.xwiki.org/t/configure-xwiki-logging/15442 "2024-08-30T14:25:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julia](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@Julia](https://forum.xwiki.org/u/Julia)\
**Post date:** [August 30, 2024, 2:25pm UTC](https://forum.xwiki.org/t/configure-xwiki-logging/15442/1 "2024-08-30T14:25:51Z")

</div>

Is there any documentation about the details of a given logger,  
e.g. `org.xwiki.notifications.filters.internal.UserAddedEventListener`

- How is the logger configured?
- What is it logging at each Log-Level?

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [August 30, 2024, 3:33pm UTC](https://forum.xwiki.org/t/configure-xwiki-logging/15442/2 "2024-08-30T15:33:26Z")

</div>

> [@Julia](#):
>
> How is the logger configured?

You might want to look at [https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Logging#HConfiguringLogging](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Logging#HConfiguringLogging). By default, all loggers are configured in logback.xml, and you can see in the [Log administration](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Logging#HUsingtheLogApplication) what is the level of each logger.

> [@Julia](#):
>
> What is it logging at each Log-Level?

I think in most cases you will have to look at [the class](https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-default/src/main/java/org/xwiki/notifications/filters/internal/UserAddedEventListener.java) to know this (each logger is a class or a package which contains classes). And in this specific case, the answer is that it only has one error log, so not much to configure.

---

<div class="post-metadata">

**Author:** ![Julia](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@Julia](https://forum.xwiki.org/u/Julia)\
**Post date:** [September 10, 2024, 3:26pm UTC](https://forum.xwiki.org/t/configure-xwiki-logging/15442/3 "2024-09-10T15:26:58Z")

</div>

Thank you for your response, but the AdminGuide wasn’t what I was looking for.

Let’s use ISO/IEC 27002 as an example of a set of requirements for logging. ISO/IEC 27002 states as guidance for A.8.15. Logging:

> The following events should be considered for logging:  
> a) successful and rejected system access attempts;  
> b) successful and rejected data and other resource access attempts;  
> c) changes to system configuration;  
> d) use of privileges;  
> e) use of utility programs and applications;  
> f) files accessed and the type of access, including deletion of important data files;  
> g) alarms raised by the access control system;  
> h) activation and de-activation of security systems, such as anti-virus systems and intrusion detection systems;  
> i) creation, modification or deletion of identities;  
> j) transactions executed by users in applications. In some cases, the applications are a service or product provided or run by a third party.

In the log administration, there are about 2500 loggers, each with five log levels. However, it’s unclear what a specific logger actually logs when it’s configured. This can’t be a trial-and-error process to find an answer what to configure to be compliant to the ISO/IEC 27002 requirements, can it?

The same problem occurs with any other list of requirements, whether contractual or regulatory.

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [September 10, 2024, 3:55pm UTC](https://forum.xwiki.org/t/configure-xwiki-logging/15442/4 "2024-09-10T15:55:36Z")

</div>

> [@Julia](#):
>
> it’s unclear what a specific logger actually logs when it’s configured.

There is no central exhaustive documentation of all the logs that exist right now (and there probably never will be), if that’s what you are asking.

That being said, it’s extremely rare to have the need to know what a logger is about. It’s usually the other way around: some feature documentation mentioning some debug log you can enable on some logger to get more information about what happen (a typical example of that is [https://extensions.xwiki.org/xwiki/bin/view/Extension/OpenID%20Connect/OpenID%20Connect%20Authenticator/#HEnableDEBUGlog](https://extensions.xwiki.org/xwiki/bin/view/Extension/OpenID%20Connect/OpenID%20Connect%20Authenticator/#HEnableDEBUGlog)).

> [@Julia](#):
>
> This can’t be a trial-and-error process to find an answer what to configure to be compliant to the ISO/IEC 27002 requirements, can it?

As I said, pretty all loggers (except for a couple of them, I think) are classes, so you can also generally find what they log by looking at the code. But of course, it implies that you understand Java code a little bit.

---

<div class="post-metadata">

**Author:** ![CycleSEC](https://forum.xwiki.org/user_avatar/forum.xwiki.org/cyclesec/32/6360_2.png) [@CycleSEC](https://forum.xwiki.org/u/CycleSEC)\
**Post date:** [September 10, 2024, 5:33pm UTC](https://forum.xwiki.org/t/configure-xwiki-logging/15442/5 "2024-09-10T17:33:16Z")

</div>

Monitoring XWiki from a security perspective is not straightforward 😉

At least there should be some kind of compliance or mapping to the events provided in the OWASP Logging Vocabulary Cheat Sheet: [Logging Vocabulary - OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Vocabulary_Cheat_Sheet.html) This is the list of events I would be interested in.

---

<div class="post-metadata">

**Author:** ![CycleSEC](https://forum.xwiki.org/user_avatar/forum.xwiki.org/cyclesec/32/6360_2.png) [@CycleSEC](https://forum.xwiki.org/u/CycleSEC)\
**Post date:** [September 10, 2024, 8:20pm UTC](https://forum.xwiki.org/t/configure-xwiki-logging/15442/6 "2024-09-10T20:20:29Z")

</div>

> [@tmortagne](#):
>
> That being said, it’s extremely rare to have the need to know what a logger is about.

I do not agree 😉  
From a security perspective (and, of course, privacy perspective), this is the usual and only need to know, isn’t it?

* * *

I set up a draft documentation page:  
[Application Security Logging](https://dev.xwiki.org/xwiki/bin/view/Drafts/Application%20Security%20Logging/)

It is set up as a compliance mapping to the OWASP Logging Vocabulary Cheat Sheet: [Logging Vocabulary - OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Vocabulary_Cheat_Sheet.html)

It includes a `<logger name="xxx" level="xxx"/>` code snippet for each logger configuration that needs to be set in the `logback.xml` file to comply with the OWASP recommendations.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 11, 2024, 12:08pm UTC](https://forum.xwiki.org/t/configure-xwiki-logging/15442/7 "2024-09-11T12:08:46Z")

</div>

What could be nice in the future, is to have a lot more events; for authentication (with a status code: success, fail, etc), logging out, access to resources, etc.

This would allow extensions or custom code to register to these events and do what they want: log, send an alert to an external system, etc.
