This is an automated email from the ASF dual-hosted git repository. pkarwasz pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 04f13fb1c6c4f55957daf926d7ea8419b78ceb4f Author: Piotr P. Karwasz <[email protected]> AuthorDate: Fri Jul 5 17:12:18 2024 +0200 Missing licenses --- .../modules/ROOT/examples/manual/filters/global.groovy | 16 ++++++++++++++++ .../modules/ROOT/examples/manual/filters/local.groovy | 16 ++++++++++++++++ src/site/antora/modules/ROOT/pages/manual/filters.adoc | 4 ++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/site/antora/modules/ROOT/examples/manual/filters/global.groovy b/src/site/antora/modules/ROOT/examples/manual/filters/global.groovy index e0b6325cf2..01f836bb57 100644 --- a/src/site/antora/modules/ROOT/examples/manual/filters/global.groovy +++ b/src/site/antora/modules/ROOT/examples/manual/filters/global.groovy @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ Throwable lastParam = parameters?.last() instanceof Throwable ? parameters.last() : null Throwable actualThrowable = throwable ?: message?.throwable ?: lastParam return actualThrowable instanceof DataAccessException \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/manual/filters/local.groovy b/src/site/antora/modules/ROOT/examples/manual/filters/local.groovy index b87dc5faaf..fc5dc06667 100644 --- a/src/site/antora/modules/ROOT/examples/manual/filters/local.groovy +++ b/src/site/antora/modules/ROOT/examples/manual/filters/local.groovy @@ -1 +1,17 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ return logEvent.throwable instanceof DataAccessException; \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/pages/manual/filters.adoc b/src/site/antora/modules/ROOT/pages/manual/filters.adoc index e32b350254..8c4d8a8ca1 100644 --- a/src/site/antora/modules/ROOT/pages/manual/filters.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/filters.adoc @@ -1329,7 +1329,7 @@ you can use a simple Groovy script: .`scripts/local.groovy` [source,groovy] ---- -include::example$manual/filters/local.groovy[] +include::example$manual/filters/local.groovy[lines=17..-1] ---- You can then integrate the script in a Log4j configuration: @@ -1376,7 +1376,7 @@ The script becomes: .`scripts/global.groovy` [source,groovy] ---- -include::example$manual/filters/global.groovy[] +include::example$manual/filters/global.groovy[lines=17..-1] ---- You can use it as a global filter:
