2 * Copyright (C) 2021 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_RULE_LOG4J_LOGGING_H
9 #define LTTNG_EVENT_RULE_LOG4J_LOGGING_H
11 #include <lttng/event-rule/event-rule.h>
12 #include <lttng/log-level-rule.h>
13 #include <lttng/event.h>
20 * Create a newly allocated log4j logging event rule.
22 * The default name pattern is '*'.
24 * Returns a new event rule on success, NULL on failure. This event rule must be
25 * destroyed using lttng_event_rule_destroy().
27 extern struct lttng_event_rule
*lttng_event_rule_log4j_logging_create(void);
30 * Set the name pattern of a log4j logging event rule.
32 * Pattern can contain wildcard '*'. See man lttng-enable-event.
34 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
35 * if invalid parameters are passed.
37 extern enum lttng_event_rule_status
lttng_event_rule_log4j_logging_set_name_pattern(
38 struct lttng_event_rule
*rule
, const char *pattern
);
41 * Get the name pattern of a log4j logging event rule.
43 * The caller does not assume the ownership of the returned pattern. The
44 * pattern shall only only be used for the duration of the event rule's
45 * lifetime, or before a different pattern is set.
47 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's pattern
48 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
49 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
50 * was not set prior to this call.
52 extern enum lttng_event_rule_status
lttng_event_rule_log4j_logging_get_name_pattern(
53 const struct lttng_event_rule
*rule
, const char **pattern
);
56 * Set the filter expression of a log4j logging event rule.
58 * The expression is copied internally.
60 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
61 * if invalid parameters are passed.
63 extern enum lttng_event_rule_status
lttng_event_rule_log4j_logging_set_filter(
64 struct lttng_event_rule
*rule
, const char *expression
);
67 * Get the filter expression of a log4j logging event rule.
69 * The caller does not assume the ownership of the returned filter expression.
70 * The filter expression shall only only be used for the duration of the event
71 * rule's lifetime, or before a different filter expression is set.
73 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
74 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
75 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
76 * was not set prior to this call.
78 extern enum lttng_event_rule_status
lttng_event_rule_log4j_logging_get_filter(
79 const struct lttng_event_rule
*rule
, const char **expression
);
82 * Set the log level rule of a log4j logging event rule.
84 * The log level rule is copied internally.
86 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
87 * if invalid parameters are passed.
89 extern enum lttng_event_rule_status
90 lttng_event_rule_log4j_logging_set_log_level_rule(struct lttng_event_rule
*rule
,
91 const struct lttng_log_level_rule
*log_level_rule
);
94 * Get the log level rule of a log4j logging event rule.
96 * The caller does not assume the ownership of the returned log level rule. The
97 * log level rule shall only only be used for the duration of the event rule's
98 * lifetime, or before a different log level rule is set.
100 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the log level rule output
101 * parameter on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter
102 * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level rule was not set prior
105 extern enum lttng_event_rule_status
106 lttng_event_rule_log4j_logging_get_log_level_rule(
107 const struct lttng_event_rule
*rule
,
108 const struct lttng_log_level_rule
**log_level_rule
);
114 #endif /* LTTNG_EVENT_RULE_LOG4J_LOGGING_H */
This page took 0.031028 seconds and 4 git commands to generate.