Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEODE-10231 : Add configuration for suppressing FunctionException logging #7584

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ See [Authorization of Function Execution](../../managing/security/implementing_a
- For partitioned regions, the `PartitionRegionHelper` provides access to additional information and data for the region. For single regions, use `getLocalDataForContext`. For colocated regions, use `getLocalColocatedRegions`.
**Note:**
When you use `PartitionRegionHelper.getLocalDataForContext`, `putIfAbsent` may not return expected results if you are working on local data set instead of the region.
4. To propagate an error condition or exception back to the caller of the function, throw a FunctionException from the `execute` method. <%=vars.product_name%> transmits the exception back to the caller as if it had been thrown on the calling side. See the Java API documentation for [FunctionException](/releases/latest/javadoc/org/apache/geode/cache/execute/FunctionException.html) for more information.
4. To propagate an error condition or exception back to the caller of the function, throw a FunctionException from the `execute` method. <%=vars.product_name%> transmits the exception back to the caller as if it had been thrown on the calling side. See the Java API documentation for [FunctionException](/releases/latest/javadoc/org/apache/geode/cache/execute/FunctionException.html) for more information. Note, FunctionException logging on server side can be disabled by the Log4J filter for marker FUNCTION\_EXCEPTION\_MARKER. See [Advanced Users—Configuring Log4j 2 for <%=vars.product_name%>](../../managing/logging/configuring_log4j2.html) for more details.

Example function code:

Expand Down
5 changes: 5 additions & 0 deletions geode-docs/managing/logging/configuring_log4j2.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ Custom Log4j 2 configuration in <%=vars.product_name%> comes with some caveats a

You can enable the GEODE\_VERBOSE log statements by changing `onMatch="DENY"` to `onMatch="ACCEPT"`. Typically, it's more useful to simply enable DEBUG or TRACE on certain classes or packages instead of for the entire <%=vars.product_name%> product. However, this setting can be used for internal debugging purposes if all other debugging methods fail.
- The usage of filters can have an impact on performance. <%=vars.product_name%> has some logging optimizations that are deactivated when filters are used (except for the GEODE_VERBOSE marker mentioned previously).
- The FUNCTION\_EXCEPTION\_MARKER marker (Log4J2 Marker) can be used to FunctionException logs on server side during execution function. For example <%=vars.product_name%> `log4j2.xml` filter disables FunctionException logs with this line:
zsitole marked this conversation as resolved.
Show resolved Hide resolved
zsitole marked this conversation as resolved.
Show resolved Hide resolved

``` pre
<MarkerFilter marker="FUNCTION_EXCEPTION_MARKER" onMatch="DENY" onMismatch="NEUTRAL"/>
```

- Geode's custom Log4j 2 Appenders can be used in a custom log4j2.xml. This requires:

Expand Down