diff --git a/.ci/settings.xml b/.ci/settings.xml index 3b6791ab..b0f79346 100644 --- a/.ci/settings.xml +++ b/.ci/settings.xml @@ -6,12 +6,7 @@ - sonatype-nexus-snapshots - ${env.SERVER_USERNAME} - ${env.SERVER_PASSWORD} - - - sonatype-nexus-staging + central ${env.SERVER_USERNAME} ${env.SERVER_PASSWORD} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..5140e09b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +* @elastic/apm-agent-java +/.github/actions/ @elastic/apm-agent-java @elastic/observablt-ci +/.github/workflows/ @elastic/apm-agent-java @elastic/observablt-ci diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b9a9834d..922e2a43 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,21 @@ updates: interval: "weekly" day: "sunday" time: "22:00" + exclude-paths: + - "log4j2-legacy-tests" + - "log4j-legacy-tests" + - "logback-legacy-tests" groups: github-actions: patterns: - "*" + + - package-ecosystem: pre-commit + directory: "/" + schedule: + interval: 'weekly' + day: 'sunday' + time: '22:00' + open-pull-requests-limit: 5 + labels: + - 'changelog:dependencies' diff --git a/.github/workflows/addToProject.yml b/.github/workflows/addToProject.yml index 0feaa078..6536fe84 100644 --- a/.github/workflows/addToProject.yml +++ b/.github/workflows/addToProject.yml @@ -15,15 +15,12 @@ jobs: steps: - name: Get token id: get_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + uses: actions/create-github-app-token@v3 with: - app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} - private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} - permissions: >- - { - "organization_projects": "write", - "issues": "read" - } + app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permission-organization-projects: write + permission-issues: read - name: Assign issues with milestones to project uses: elastic/assign-one-project-github-action@1.2.2 diff --git a/.github/workflows/catalog-info.yml b/.github/workflows/catalog-info.yml new file mode 100644 index 00000000..3f4320ae --- /dev/null +++ b/.github/workflows/catalog-info.yml @@ -0,0 +1,24 @@ +--- +name: catalog-info + +on: + pull_request: + branches: + - main + paths: + - 'catalog-info.yaml' + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + steps: + - uses: actions/checkout@v6 + + - uses: elastic/oblt-actions/elastic/validate-catalog@v1 + diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index bb466166..cf37c3d8 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -1,19 +1,15 @@ name: docs-build - on: + pull_request: + types: [opened, synchronize, reopened] push: - branches: - - main - pull_request_target: ~ + branches: [main] merge_group: ~ - +permissions: + contents: read + pull-requests: read jobs: - docs-preview: - uses: elastic/docs-builder/.github/workflows/preview-build.yml@main + build: + uses: elastic/docs-actions/.github/workflows/docs-build.yml@v1 with: - path-pattern: docs/** - permissions: - deployments: write - id-token: write - contents: read - pull-requests: read + enable-vale-linting: true diff --git a/.github/workflows/docs-cleanup.yml b/.github/workflows/docs-cleanup.yml deleted file mode 100644 index f83e017b..00000000 --- a/.github/workflows/docs-cleanup.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: docs-cleanup - -on: - pull_request_target: - types: - - closed - -jobs: - docs-preview: - uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main - permissions: - contents: none - id-token: write - deployments: write diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml new file mode 100644 index 00000000..3e44d157 --- /dev/null +++ b/.github/workflows/docs-deploy.yml @@ -0,0 +1,16 @@ +name: docs-deploy +on: + workflow_run: + workflows: [docs-build] + types: [completed] +permissions: + contents: read + deployments: write + id-token: write + pull-requests: write + actions: read +jobs: + deploy: + uses: elastic/docs-actions/.github/workflows/docs-deploy.yml@v1 + with: + enable-vale-linting: true diff --git a/.github/workflows/docs-preview-cleanup.yml b/.github/workflows/docs-preview-cleanup.yml new file mode 100644 index 00000000..b234c235 --- /dev/null +++ b/.github/workflows/docs-preview-cleanup.yml @@ -0,0 +1,11 @@ +name: docs-preview-cleanup +on: + pull_request_target: + types: [closed] +permissions: + contents: none + deployments: write + id-token: write +jobs: + cleanup: + uses: elastic/docs-actions/.github/workflows/docs-preview-cleanup.yml@v1 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 6473cc44..7a547899 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,9 +1,9 @@ name: "Issue Labeler" on: issues: - types: [opened] + types: [opened, edited, reopened] pull_request_target: - types: [opened] + types: [opened, synchronize, reopened] permissions: contents: read @@ -14,52 +14,98 @@ jobs: triage: runs-on: ubuntu-latest steps: - - name: Add agent-java label - uses: AlexanderWert/issue-labeler@32be4a3c3d8f009c2741af471994337c34b4cb6f # v2.3 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler-config.yml - enable-versioned-regex: 0 + - name: Get token id: get_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permission-members: read + permission-organization-projects: write + permission-issues: read + permission-pull-requests: write + + - name: Add agent-java label + run: gh issue edit "${NUMBER}" --add-label "agent-java" --repo "${{ github.repository }}" + env: + NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - id: is_elastic_member + uses: elastic/oblt-actions/github/is-member-of@v1 with: - app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} - private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} - permissions: >- - { - "members": "read", - "organization_projects": "write", - "issues": "read" - } - - name: Check team membership for user - uses: elastic/get-user-teams-membership@1.1.0 - id: checkUserMember + github-org: "elastic" + github-user: ${{ github.actor }} + github-token: ${{ steps.get_token.outputs.token }} + + - id: user_type + uses: elastic/oblt-actions/github/user-type@v1 with: - username: ${{ github.actor }} - team: 'apm' - usernamesToExclude: | - apmmachine - dependabot - obltmachine - GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} - - name: Show team membership + github-user: ${{ github.actor }} + github-token: ${{ steps.get_token.outputs.token }} + + - name: debug run: | - echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}" - echo "::debug::isExcluded: ${{ steps.checkUserMember.outputs.isExcluded }}" - - name: Add community and triage lables - if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true' - uses: AlexanderWert/issue-labeler@32be4a3c3d8f009c2741af471994337c34b4cb6f # v2.3 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/community-label.yml - enable-versioned-regex: 0 + echo "::notice:: is_elastic_member=${{ steps.is_elastic_member.outputs.result }}" + echo "::notice:: user_type=${{ steps.user_type.outputs.result }}" + echo "::notice:: github.actor=${{ github.actor }}" + echo "::notice:: github.event_name=${{ github.event_name }}" + + - name: Add community and triage labels + if: steps.is_elastic_member.outputs.result == 'false' && steps.user_type.outputs.result == 'user' + run: gh issue edit "${NUMBER}" --add-label "community,triage" --repo "${{ github.repository }}" + env: + NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Assign new internal pull requests to author + id: assign-to-author + if: steps.is_elastic_member.outputs.result == 'true' && github.event_name == 'pull_request_target' + run: gh issue edit "${NUMBER}" --add-assignee "${{ github.actor }}" --repo "${{ github.repository }}" + env: + NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Assign new internal pull requests to project - uses: elastic/assign-one-project-github-action@1.2.2 - if: (steps.checkUserMember.outputs.isTeamMember == 'true' || steps.checkUserMember.outputs.isExcluded == 'true') && github.event.pull_request + id: add-to-project + if: steps.is_elastic_member.outputs.result == 'true' && github.event_name == 'pull_request_target' + uses: elastic/oblt-actions/github/project-add@v1 with: - project: 'https://github.com/orgs/elastic/projects/454' - project_id: '5882982' - column_name: 'In Progress' - env: - MY_GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} + github-token: ${{ steps.get_token.outputs.token }} + project-id: 1829 + item-url: ${{ github.event.pull_request.html_url }} + + - name: set status in project + id: set-project-status-field + if: steps.is_elastic_member.outputs.result == 'true' && github.event_name == 'pull_request_target' + uses: elastic/oblt-actions/github/project-field-set@v1 + with: + github-token: ${{ steps.get_token.outputs.token }} + project-id: 1829 + item-id: ${{ steps.add-to-project.outputs.item-id }} + field-name: 'Status' + field-value: 'In Progress' + + - name: set agent in project + id: set-project-agent-field + if: steps.is_elastic_member.outputs.result == 'true' && github.event_name == 'pull_request_target' + uses: elastic/oblt-actions/github/project-field-set@v1 + with: + github-token: ${{ steps.get_token.outputs.token }} + project-id: 1829 + item-id: ${{ steps.add-to-project.outputs.item-id }} + field-name: 'Agent' + field-value: 'java' + + - name: set iteration in project + id: set-project-iteration-field + if: steps.is_elastic_member.outputs.result == 'true' && github.event_name == 'pull_request_target' + uses: elastic/oblt-actions/github/project-field-set@v1 + with: + github-token: ${{ steps.get_token.outputs.token }} + project-id: 1829 + item-id: ${{ steps.add-to-project.outputs.item-id }} + field-name: 'Iteration' + field-value: '@current' + field-type: 'iteration' diff --git a/.github/workflows/maven-goal/action.yml b/.github/workflows/maven-goal/action.yml index 7b8dbb96..4cf9c6e9 100644 --- a/.github/workflows/maven-goal/action.yml +++ b/.github/workflows/maven-goal/action.yml @@ -25,5 +25,7 @@ runs: java-version-file: .java-version distribution: ${{ inputs.distribution }} cache: 'maven' - - run: ${{ inputs.command }} + - run: "${COMMAND}" shell: ${{ inputs.shell }} + env: + COMMAND: ${{ inputs.command }} \ No newline at end of file diff --git a/.github/workflows/pre-post-release.yml b/.github/workflows/pre-post-release.yml index eda93961..5807cecf 100644 --- a/.github/workflows/pre-post-release.yml +++ b/.github/workflows/pre-post-release.yml @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Validate tag does not exist on current commit @@ -54,19 +54,16 @@ jobs: steps: - name: Get token id: get_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + uses: actions/create-github-app-token@v3 with: - app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} - private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} - permissions: >- - { - "contents": "write", - "pull_requests": "write" - } - repositories: >- - ["ecs-logging-java"] + app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permission-contents: write + permission-pull-requests: write + repositories: | + ecs-logging-java - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.ref }} token: ${{ steps.get_token.outputs.token }} @@ -99,10 +96,14 @@ jobs: - name: Push the ${{ inputs.phase }} release branch run: | git add --all - git commit -m "${{ inputs.phase }} release: ecs-logging-java v${{ env.RELEASE_VERSION }}" + git commit -m "${PHASE} release: ecs-logging-java v${{ env.RELEASE_VERSION }}" git push origin ${{ env.BRANCH_NAME }} + env: + PHASE: ${{ inputs.phase }} - name: Create the ${{ inputs.phase }} release PR - run: gh pr create --title="${{ inputs.pr_title }}" --base main --head ${{ env.BRANCH_NAME }} -b "${{ inputs.pr_body }}" + run: gh pr create --title="${PR_TITLE}" --base main --head ${{ env.BRANCH_NAME }} -b "${PR_BODY}" env: GH_TOKEN: ${{ steps.get_token.outputs.token }} + PR_TITLE: ${{ inputs.pr_title }} + PR_BODY: ${{ inputs.pr_body }} diff --git a/.github/workflows/release-step-3.yml b/.github/workflows/release-step-3.yml index d68957ef..373aeb2d 100644 --- a/.github/workflows/release-step-3.yml +++ b/.github/workflows/release-step-3.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: ref: ${{ inputs.ref }} fetch-depth: 0 @@ -67,6 +67,7 @@ jobs: needs: - validate-tag permissions: + artifact-metadata: write attestations: write contents: write id-token: write @@ -96,7 +97,7 @@ jobs: run: tar xvf ${{ env.TARBALL_FILE }} - name: generate build provenance - uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3 + uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 with: subject-path: "${{ github.workspace }}/**/target/*.jar" @@ -138,7 +139,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ inputs.ref }} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 83060cb3..5a72c504 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -21,7 +21,7 @@ jobs: outputs: is-snapshot: ${{ steps.validate.outputs.is-snapshot }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Validate version is a snapshot version id: validate run: | @@ -38,6 +38,7 @@ jobs: needs: validate if: ${{ contains(needs.validate.outputs.is-snapshot, 'true') }} permissions: + artifact-metadata: write attestations: write contents: write id-token: write @@ -66,7 +67,7 @@ jobs: run: tar xvf ${{ env.TARBALL_FILE }} - name: generate build provenance - uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3 + uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 with: subject-path: "${{ github.workspace }}/**/target/*.jar" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9172af3..80dda950 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,17 +30,17 @@ jobs: - 'compile javadoc:javadoc' fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ./.github/workflows/maven-goal with: command: ./mvnw ${{ matrix.goal }} - name: Store test results if: matrix.goal == 'test' && (success() || failure()) - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: test-results path: '**/target/surefire-reports' - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 if: contains(matrix.goal, 'license') with: name: license-report diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index 739fd40f..9c79e716 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -15,21 +15,18 @@ jobs: contents: read packages: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get token id: get_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + uses: actions/create-github-app-token@v3 with: - app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} - private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} - permissions: >- - { - "contents": "write", - "pull_requests": "write" - } - - - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 + app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permission-contents: write + permission-pull-requests: write + + - uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 with: registry: ghcr.io username: ${{ github.actor }} diff --git a/.github/workflows/validate-tag/action.yml b/.github/workflows/validate-tag/action.yml index a982355e..07e33d72 100644 --- a/.github/workflows/validate-tag/action.yml +++ b/.github/workflows/validate-tag/action.yml @@ -15,11 +15,13 @@ runs: id: validate-tag shell: 'bash' run: | - if ! [ $(echo "${{ inputs.tag }}" | grep -P "(\d{1,2})\.(\d{1,2})\.(\d{1,2})") ]; then + if ! [ $(echo "${TAG}" | grep -P "(\d{1,2})\.(\d{1,2})\.(\d{1,2})") ]; then echo "Tag should be a SemVer format" exit 1 fi - if [ $(git tag -l "${{ inputs.tag }}") ]; then - echo "The tag ${{ inputs.tag }} already exists" + if [ $(git tag -l "${TAG}") ]; then + echo "The tag ${TAG} already exists" exit 1 fi + env: + TAG: ${{ inputs.tag }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 323c744d..0e1584e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.2.3 + rev: v6.0.0 hooks: - id: check-case-conflict - id: check-executables-have-shebangs diff --git a/.tool-versions b/.tool-versions index a744ca66..23e5cc57 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -updatecli v0.96.0 \ No newline at end of file +updatecli v0.116.3 \ No newline at end of file diff --git a/docs/docset.yml b/docs/docset.yml index 4e923a6a..abb84715 100644 --- a/docs/docset.yml +++ b/docs/docset.yml @@ -1,4 +1,6 @@ project: 'ECS Logging Java' +products: + - id: ecs-logging cross_links: - apm-agent-java - beats diff --git a/docs/reference/_structured_logging_with_log4j2.md b/docs/reference/_structured_logging_with_log4j2.md index 3662b594..013facef 100644 --- a/docs/reference/_structured_logging_with_log4j2.md +++ b/docs/reference/_structured_logging_with_log4j2.md @@ -1,6 +1,11 @@ --- +applies_to: + stack: ga + serverless: ga mapped_pages: - https://www.elastic.co/guide/en/ecs-logging/java/current/_structured_logging_with_log4j2.html +products: + - id: ecs-logging --- # Structured logging with log4j2 [_structured_logging_with_log4j2] diff --git a/docs/reference/index.md b/docs/reference/index.md index d33178a5..a941bec4 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -1,7 +1,12 @@ --- +applies_to: + stack: ga + serverless: ga mapped_pages: - https://www.elastic.co/guide/en/ecs-logging/java/current/intro.html - https://www.elastic.co/guide/en/ecs-logging/java/current/index.html +products: + - id: ecs-logging --- # ECS Logging Java [intro] diff --git a/docs/reference/setup.md b/docs/reference/setup.md index 6c6ce28d..0af8fa01 100644 --- a/docs/reference/setup.md +++ b/docs/reference/setup.md @@ -1,7 +1,12 @@ --- +applies_to: + stack: ga + serverless: ga mapped_pages: - https://www.elastic.co/guide/en/ecs-logging/java/current/setup.html navigation_title: Get started +products: + - id: ecs-logging --- # Get started with ECS Logging Java [setup] @@ -383,6 +388,11 @@ If you’re using the Elastic APM Java agent, log correlation is enabled by defa ## Step 2: Configure Filebeat [setup-step-2] +```{applies_to} +stack: ga +serverless: unavailable +``` + :::::::{tab-set} ::::::{tab-item} Log file @@ -476,6 +486,11 @@ For more information, see the [Filebeat reference](beats://reference/filebeat/co ### When `stackTraceAsArray` is enabled [setup-stack-trace-as-array] +```{applies_to} +stack: ga +serverless: unavailable +``` + Filebeat can normally only decode JSON if there is one JSON object per line. When `stackTraceAsArray` is enabled, there will be a new line for each stack trace element which improves readability. But when combining the multiline settings with a `decode_json_fields` we can also handle multi-line JSON: ```yaml diff --git a/ecs-logging-core/pom.xml b/ecs-logging-core/pom.xml index 4834d4d6..6bd23fa3 100644 --- a/ecs-logging-core/pom.xml +++ b/ecs-logging-core/pom.xml @@ -3,11 +3,12 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 ecs-logging-core + ${project.groupId}:${project.artifactId} ${project.basedir}/.. diff --git a/ecs-logging-core/src/main/java/co/elastic/logging/EcsJsonSerializer.java b/ecs-logging-core/src/main/java/co/elastic/logging/EcsJsonSerializer.java index dfb7411d..17ecd925 100644 --- a/ecs-logging-core/src/main/java/co/elastic/logging/EcsJsonSerializer.java +++ b/ecs-logging-core/src/main/java/co/elastic/logging/EcsJsonSerializer.java @@ -26,8 +26,11 @@ import java.io.PrintWriter; import java.io.Writer; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -37,6 +40,20 @@ public class EcsJsonSerializer { private static final ThreadLocal messageStringBuilder = new ThreadLocal(); private static final String NEW_LINE = System.getProperty("line.separator"); private static final Pattern NEW_LINE_PATTERN = Pattern.compile("\\r\\n|\\n|\\r"); + private static final int INITIAL_BUFFER_CAPACITY = 1024; + static final int MAX_BUFFER_CAPACITY = 8192; + + // Those keys are not expected to be used in MDC, thus we filter-out those keys to prevent major issues + // when they are present as top-level MDC keys. + private static final Set RESERVED_KEYS = new HashSet(Arrays.asList( + "@timestamp", + "message", + "log.logger", + "log.level", + "event.dataset", + "process.thread.name", + "process.thread.id", + "ecs.version")); public static CharSequence toNullSafeString(final CharSequence s) { return s == null ? "" : s; @@ -194,16 +211,24 @@ public static void serializeOrigin(StringBuilder builder, String fileName, Strin public static void serializeMDC(StringBuilder builder, Map properties) { if (properties != null && !properties.isEmpty()) { for (Map.Entry entry : properties.entrySet()) { - builder.append('\"'); String key = entry.getKey(); - JsonUtils.quoteAsString(key, builder); - builder.append("\":\""); - JsonUtils.quoteAsString(toNullSafeString(String.valueOf(entry.getValue())), builder); - builder.append("\","); + String value = String.valueOf(entry.getValue()); + serializeMdcEntry(builder, key, value); } } } + public static void serializeMdcEntry(StringBuilder builder, String key, String value) { + if (RESERVED_KEYS.contains(key)) { + return; + } + builder.append('\"'); + JsonUtils.quoteAsString(key, builder); + builder.append("\":\""); + JsonUtils.quoteAsString(toNullSafeString(value), builder); + builder.append("\","); + } + public static void serializeException(StringBuilder builder, Throwable thrown, boolean stackTraceAsArray) { if (thrown != null) { builder.append("\"error.type\":\""); @@ -302,6 +327,10 @@ private static void formatStackTraceAsArray(StringBuilder builder, CharSequence if (index < length) { // append remaining line appendStackTraceLine(builder, stackTrace, index, length); + } else { + // stack trace ends with newline, remove trailing comma and newline + removeIfEndsWith(builder, NEW_LINE); + removeIfEndsWith(builder, ","); } } else { // no newlines found, add entire stack trace as single element @@ -335,13 +364,23 @@ public static boolean endsWith(StringBuilder sb, String ending) { return true; } + /** + * Returns a thread-local {@link StringBuilder} for temporary message formatting. + *

+ * If the buffer has grown beyond {@link #MAX_BUFFER_CAPACITY} (e.g. due to a large stack trace), + * it is discarded and replaced with a fresh instance to prevent unbounded memory retention in + * long-lived thread-pool threads. + * + * @see #381 + */ public static StringBuilder getMessageStringBuilder() { StringBuilder result = messageStringBuilder.get(); - if (result == null) { - result = new StringBuilder(1024); + if (result == null || result.capacity() > MAX_BUFFER_CAPACITY) { + result = new StringBuilder(INITIAL_BUFFER_CAPACITY); messageStringBuilder.set(result); + } else { + result.setLength(0); } - result.setLength(0); return result; } diff --git a/ecs-logging-core/src/test/java/co/elastic/logging/EcsJsonSerializerTest.java b/ecs-logging-core/src/test/java/co/elastic/logging/EcsJsonSerializerTest.java index 3eca5e9e..59537070 100644 --- a/ecs-logging-core/src/test/java/co/elastic/logging/EcsJsonSerializerTest.java +++ b/ecs-logging-core/src/test/java/co/elastic/logging/EcsJsonSerializerTest.java @@ -32,7 +32,9 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import java.util.stream.StreamSupport; @@ -99,7 +101,7 @@ void testEscaping() throws IOException { } @Test - void serializeNullDoesNotThrowAnException() throws JsonProcessingException { + void serializeNullDoesNotThrowAnException() { StringBuilder stringBuilder = new StringBuilder(); EcsJsonSerializer.serializeFormattedMessage(stringBuilder, null); assertThat(stringBuilder.toString()).isEqualTo("\"message\":\"null\","); @@ -192,9 +194,61 @@ void serializeExceptionWithNullMessage() throws JsonProcessingException { assertThat(jsonNode.get(ERROR_MESSAGE)).isNull(); } + @Test + void getMessageStringBuilderDiscardsOversizedBuffer() { + // First call: initializes the thread-local StringBuilder + StringBuilder sb1 = EcsJsonSerializer.getMessageStringBuilder(); + assertThat(sb1.capacity()).isLessThanOrEqualTo(EcsJsonSerializer.MAX_BUFFER_CAPACITY); + + // Simulate a large log message / stack trace that bloats the buffer + sb1.append("x".repeat(EcsJsonSerializer.MAX_BUFFER_CAPACITY + 1)); + assertThat(sb1.capacity()).isGreaterThan(EcsJsonSerializer.MAX_BUFFER_CAPACITY); + + // Next call should detect the oversized buffer and replace it + StringBuilder sb2 = EcsJsonSerializer.getMessageStringBuilder(); + assertThat(sb2).isNotSameAs(sb1); + assertThat(sb2.capacity()).isLessThanOrEqualTo(EcsJsonSerializer.MAX_BUFFER_CAPACITY); + assertThat(sb2.length()).isZero(); + } + + @Test + void getMessageStringBuilderReuseNormallySizedBuffer() { + // First call: initializes the thread-local StringBuilder + StringBuilder sb1 = EcsJsonSerializer.getMessageStringBuilder(); + + // Append something that stays within the threshold + sb1.append("small message"); + assertThat(sb1.capacity()).isLessThanOrEqualTo(EcsJsonSerializer.MAX_BUFFER_CAPACITY); + + // Next call should reuse the same instance (just cleared) + StringBuilder sb2 = EcsJsonSerializer.getMessageStringBuilder(); + assertThat(sb2).isSameAs(sb1); + assertThat(sb2.length()).isZero(); + } + private void assertRemoveIfEndsWith(String builder, String ending, String expected) { StringBuilder sb = new StringBuilder(builder); EcsJsonSerializer.removeIfEndsWith(sb, ending); assertThat(sb.toString()).isEqualTo(expected); } + + @Test + void serializeMdc() throws JsonProcessingException { + StringBuilder jsonBuilder = new StringBuilder(); + EcsJsonSerializer.serializeObjectStart(jsonBuilder, 0); + Map mdc = new HashMap(); + mdc.put("message", "mdc message"); + mdc.put("@timestamp", "mdc timestamp"); + mdc.put("mdc.key1", "mdc value 1"); + mdc.put("mdc_key2", "mdc value 2"); + EcsJsonSerializer.serializeFormattedMessage(jsonBuilder, "formatted message"); + EcsJsonSerializer.serializeMDC(jsonBuilder, mdc); + EcsJsonSerializer.serializeObjectEnd(jsonBuilder); + + JsonNode jsonNode = objectMapper.readTree(jsonBuilder.toString()); + assertThat(jsonNode.get("message").textValue()).isEqualTo("formatted message"); + assertThat(jsonNode.get("@timestamp").textValue()).isEqualTo("1970-01-01T00:00:00.000Z"); + assertThat(jsonNode.get("mdc.key1").textValue()).isEqualTo("mdc value 1"); + assertThat(jsonNode.get("mdc_key2").textValue()).isEqualTo("mdc value 2"); + } } diff --git a/jboss-logmanager-ecs-formatter/pom.xml b/jboss-logmanager-ecs-formatter/pom.xml index b3216522..0576c088 100644 --- a/jboss-logmanager-ecs-formatter/pom.xml +++ b/jboss-logmanager-ecs-formatter/pom.xml @@ -3,7 +3,7 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 diff --git a/jul-ecs-formatter/pom.xml b/jul-ecs-formatter/pom.xml index 1a76b204..26557f97 100644 --- a/jul-ecs-formatter/pom.xml +++ b/jul-ecs-formatter/pom.xml @@ -3,7 +3,7 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 diff --git a/jul-ecs-formatter/src/test/java/co/elastic/logging/jul/EcsFormatterTest.java b/jul-ecs-formatter/src/test/java/co/elastic/logging/jul/EcsFormatterTest.java index 573114de..ea92a0fe 100644 --- a/jul-ecs-formatter/src/test/java/co/elastic/logging/jul/EcsFormatterTest.java +++ b/jul-ecs-formatter/src/test/java/co/elastic/logging/jul/EcsFormatterTest.java @@ -55,7 +55,7 @@ void setUp() { } @Test - public void testFormatWithIncludeOriginFlag() throws Exception { + public void testFormatWithIncludeOriginFlag() { formatter.setIncludeOrigin(true); final String result = formatter.format(record); @@ -65,13 +65,13 @@ public void testFormatWithIncludeOriginFlag() throws Exception { } @Test - public void testFormatWithoutIncludeOriginFlag() throws Exception { + public void testFormatWithoutIncludeOriginFlag() { final JsonNode result = parseJson(formatter.format(record)); assertThat(result.get("log.origin")).isNull(); } @Test - public void testFormatWithoutLoggerName() throws Exception { + public void testFormatWithoutLoggerName() { record.setLoggerName(null); final JsonNode result = parseJson(formatter.format(record)); @@ -80,7 +80,7 @@ public void testFormatWithoutLoggerName() throws Exception { } @Test - public void testFormatWithEmptyLoggerName() throws Exception { + public void testFormatWithEmptyLoggerName() { record.setLoggerName(""); final JsonNode result = parseJson(formatter.format(record)); @@ -89,7 +89,7 @@ public void testFormatWithEmptyLoggerName() throws Exception { } @Test - public void testFormatWithInnerClassName() throws Exception { + public void testFormatWithInnerClassName() { formatter.setIncludeOrigin(true); record.setSourceClassName("test.ExampleClass$InnerClass"); @@ -99,7 +99,7 @@ public void testFormatWithInnerClassName() throws Exception { } @Test - public void testFormatWithInvalidClassName() throws Exception { + public void testFormatWithInvalidClassName() { formatter.setIncludeOrigin(true); record.setSourceClassName("$test.ExampleClass"); @@ -110,13 +110,23 @@ public void testFormatWithInvalidClassName() throws Exception { @Test void testMdcSerialization_singleEntry() { - Map mdc = new HashMap<>(); + Map mdc = new HashMap(); TestMdcEcsFormatter mdcFormatter = new TestMdcEcsFormatter(mdc); mdc.put("mdc.key", "value"); JsonNode result = parseJson(mdcFormatter.format(record)); assertThat(result.get("mdc.key").textValue()).isEqualTo("value"); } + @Test + void testMdcSerialization_filterEntries() { + Map mdc = new HashMap(); + TestMdcEcsFormatter mdcFormatter = new TestMdcEcsFormatter(mdc); + mdc.put("message", "mdc message"); + mdc.put("@timestamp", "mdc timestamp"); + JsonNode result = parseJson(mdcFormatter.format(record)); + assertThat(result.get("message").textValue()).isEqualTo(record.getMessage()); + } + private static JsonNode parseJson(String formatter) { try { return objectMapper.readTree(formatter); diff --git a/log4j-ecs-layout/pom.xml b/log4j-ecs-layout/pom.xml index 4d73cdfb..5c2f0e05 100644 --- a/log4j-ecs-layout/pom.xml +++ b/log4j-ecs-layout/pom.xml @@ -3,7 +3,7 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 diff --git a/log4j-legacy-tests/pom.xml b/log4j-legacy-tests/pom.xml index cc402057..62615457 100644 --- a/log4j-legacy-tests/pom.xml +++ b/log4j-legacy-tests/pom.xml @@ -3,15 +3,15 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 log4j-legacy-tests + ${project.groupId}:${project.artifactId} ${project.basedir}/.. - true diff --git a/log4j2-ecs-layout/pom.xml b/log4j2-ecs-layout/pom.xml index 56d610c3..f42ce968 100644 --- a/log4j2-ecs-layout/pom.xml +++ b/log4j2-ecs-layout/pom.xml @@ -3,13 +3,13 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 ${project.basedir}/.. - 2.17.1 + 2.25.4 log4j2-ecs-layout @@ -76,10 +76,31 @@ org.apache.logging.log4j - log4j-core + log4j-core-test ${version.log4j} - test-jar test + + + org.junit.platform + junit-platform-commons + + + org.junit.platform + junit-platform-launcher + + + org.junit.platform + junit-platform-engine + + + org.junit.jupiter + junit-jupiter-params + + + org.junit-pioneer + junit-pioneer + + diff --git a/log4j2-ecs-layout/src/main/java/co/elastic/logging/log4j2/DefaultMdcSerializer.java b/log4j2-ecs-layout/src/main/java/co/elastic/logging/log4j2/DefaultMdcSerializer.java index 3da690ef..a5fc6990 100644 --- a/log4j2-ecs-layout/src/main/java/co/elastic/logging/log4j2/DefaultMdcSerializer.java +++ b/log4j2-ecs-layout/src/main/java/co/elastic/logging/log4j2/DefaultMdcSerializer.java @@ -43,11 +43,7 @@ enum UsingContextData implements MdcSerializer { private static final TriConsumer WRITE_MDC = new TriConsumer() { @Override public void accept(final String key, final Object value, final StringBuilder stringBuilder) { - stringBuilder.append('\"'); - JsonUtils.quoteAsString(key, stringBuilder); - stringBuilder.append("\":\""); - JsonUtils.quoteAsString(EcsJsonSerializer.toNullSafeString(String.valueOf(value)), stringBuilder); - stringBuilder.append("\","); + EcsJsonSerializer.serializeMdcEntry(stringBuilder, key, String.valueOf(value)); } }; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/AbstractLog4j2EcsLayoutTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/AbstractLog4j2EcsLayoutTest.java index 3363a0fb..60ab1970 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/AbstractLog4j2EcsLayoutTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/AbstractLog4j2EcsLayoutTest.java @@ -31,7 +31,7 @@ import org.apache.logging.log4j.ThreadContext; import org.apache.logging.log4j.core.Logger; import org.apache.logging.log4j.message.ObjectMessage; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/CustomMdcSerializer.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/CustomMdcSerializer.java index c3bba8b1..af13021f 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/CustomMdcSerializer.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/CustomMdcSerializer.java @@ -42,11 +42,7 @@ public void serializeMdc(LogEvent event, StringBuilder builder) { // Default function for serializing MDC entries private static final TriConsumer DEFAULT_WRITE_MDC_FUNCTION = (key, value, stringBuilder) -> { - stringBuilder.append('\"'); - JsonUtils.quoteAsString(key, stringBuilder); - stringBuilder.append("\":\""); - JsonUtils.quoteAsString(EcsJsonSerializer.toNullSafeString(String.valueOf(value)), stringBuilder); - stringBuilder.append("\","); + EcsJsonSerializer.serializeMdcEntry(stringBuilder, key, String.valueOf(value)); }; // Custom function for handling a specific key diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java index 2cda0eaf..d8e09df5 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java @@ -1,3 +1,27 @@ +/*- + * #%L + * Java ECS logging + * %% + * Copyright (C) 2019 - 2026 Elastic and contributors + * %% + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. 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. + * #L% + */ package co.elastic.logging.log4j2; import static co.elastic.logging.log4j2.CustomMdcSerializer.CUSTOM_MDC_SERIALIZER_TEST_KEY; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java index 170660e9..38e5af48 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java @@ -1,3 +1,27 @@ +/*- + * #%L + * Java ECS logging + * %% + * Copyright (C) 2019 - 2026 Elastic and contributors + * %% + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. 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. + * #L% + */ package co.elastic.logging.log4j2; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/Log4j2EcsLayoutIntegrationTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/Log4j2EcsLayoutIntegrationTest.java index 24fa667b..97cd8326 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/Log4j2EcsLayoutIntegrationTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/Log4j2EcsLayoutIntegrationTest.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode; import org.apache.logging.log4j.core.LoggerContext; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/Log4j2EcsLayoutTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/Log4j2EcsLayoutTest.java index 0896ce5f..33f4af44 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/Log4j2EcsLayoutTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/Log4j2EcsLayoutTest.java @@ -27,11 +27,11 @@ import com.fasterxml.jackson.databind.JsonNode; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.Appender; -import org.apache.logging.log4j.core.BasicConfigurationFactory; +import org.apache.logging.log4j.core.test.BasicConfigurationFactory; import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.config.ConfigurationFactory; import org.apache.logging.log4j.core.util.KeyValuePair; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java index 906fe9e6..7abdc4be 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java @@ -1,3 +1,27 @@ +/*- + * #%L + * Java ECS logging + * %% + * Copyright (C) 2019 - 2026 Elastic and contributors + * %% + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. 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. + * #L% + */ package co.elastic.logging.log4j2; import org.junit.jupiter.api.Test; diff --git a/log4j2-legacy-tests/pom.xml b/log4j2-legacy-tests/pom.xml index 0aba3ee7..e7b1435b 100644 --- a/log4j2-legacy-tests/pom.xml +++ b/log4j2-legacy-tests/pom.xml @@ -3,16 +3,16 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 log4j2-legacy-tests + ${project.groupId}:${project.artifactId} 2.6 ${project.basedir}/.. - true diff --git a/logback-ecs-encoder/pom.xml b/logback-ecs-encoder/pom.xml index c03fa44f..612bfb2e 100644 --- a/logback-ecs-encoder/pom.xml +++ b/logback-ecs-encoder/pom.xml @@ -3,7 +3,7 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 diff --git a/logback-legacy-tests/pom.xml b/logback-legacy-tests/pom.xml index 1a61ad2d..775ca3d2 100644 --- a/logback-legacy-tests/pom.xml +++ b/logback-legacy-tests/pom.xml @@ -3,15 +3,15 @@ ecs-logging-java-parent co.elastic.logging - 1.7.0 + 1.8.0 4.0.0 logback-legacy-tests + ${project.groupId}:${project.artifactId} ${project.basedir}/.. - true diff --git a/pom.xml b/pom.xml index baeccd32..d6e64c92 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ co.elastic.logging ecs-logging-java-parent - 1.7.0 + 1.8.0 ${project.groupId}:${project.artifactId} ecs-logging-core @@ -16,16 +16,6 @@ log4j-legacy-tests logback-legacy-tests jul-ecs-formatter - pom 2019 @@ -67,20 +57,8 @@ UTF-8 UTF-8 ${project.basedir} - false - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - https://oss.sonatype.org/ - - sonatype-nexus-staging - ${maven-deploy-plugin.skip} - true + central + true + log4j-legacy-tests,log4j2-legacy-tests,logback-legacy-tests @@ -348,7 +324,7 @@ org.assertj assertj-core - 3.12.2 + 3.27.7 test diff --git a/updatecli-compose.yaml b/updatecli-compose.yaml index 2574eac7..24f1cfd4 100644 --- a/updatecli-compose.yaml +++ b/updatecli-compose.yaml @@ -7,11 +7,11 @@ policies: - .ci/updatecli/values.d/scm.yml - .ci/updatecli/values.d/ecs-logging-specs.yml - name: Update Updatecli policies - policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.8.0@sha256:99e9e61b501575c2c176c39f2275998d198b590a3f6b1fe829f7315f8d457e7f + policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.11.1@sha256:de145eea3f42312f4d1fdedb562adc36adcd54d7568f230ae71f931cc5288321 values: - .ci/updatecli/values.d/scm.yml - .ci/updatecli/values.d/update-compose.yml - name: Update Updatecli version - policy: ghcr.io/elastic/oblt-updatecli-policies/updatecli/version:0.2.0@sha256:013a37ddcdb627c46e7cba6fb9d1d7bc144584fa9063843ae7ee0f6ef26b4bea + policy: ghcr.io/elastic/oblt-updatecli-policies/updatecli/version:0.2.1@sha256:6fd23ee6800e330fb6aa60ae3597dceb5dde919d3562dfcf559f6e0cb87cf998 values: - - .ci/updatecli/values.d/scm.yml \ No newline at end of file + - .ci/updatecli/values.d/scm.yml