diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644
index 0000000..0ed048f
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,67 @@
+version: 2.1
+orbs:
+ gh: circleci/github-cli@2.1.0
+
+workflows:
+ version: 2
+ pr_build:
+ when:
+ not:
+ or:
+ - equal: [ dev, << pipeline.git.branch >> ]
+ - equal: [ master, << pipeline.git.branch >> ]
+ jobs:
+ # Performs a verify build for PRs
+ - validate:
+ context:
+ - Non-sensitive Env Vars
+ - maven_verify:
+ context: Non-sensitive Env Vars
+ requires:
+ - validate
+
+ stage_or_release_build:
+ when:
+ or:
+ - equal: [ dev, << pipeline.git.branch >> ]
+ - equal: [ master, << pipeline.git.branch >> ]
+ jobs:
+ # Deploys to maven central for dev (snapshot) and master builds
+ - validate:
+ context:
+ - Non-sensitive Env Vars
+ - maven_deploy:
+ context:
+ - Open Source Release Credentials
+ - Non-sensitive Env Vars
+ requires:
+ - validate
+
+jobs:
+ validate:
+ machine:
+ image: ubuntu-2204:2023.02.1
+ steps:
+ - checkout
+ - run:
+ name: "List installed packages"
+ command: apt list --installed
+ - run:
+ name: "Validate build"
+ command: source Infrastructure/Build-Scripts/validate_build.sh
+ maven_verify:
+ machine:
+ image: ubuntu-2204:2023.02.1
+ steps:
+ - checkout
+ - run:
+ name: "Perform Maven Verify"
+ command: source Infrastructure/Build-Scripts/mvn_verify.sh
+ maven_deploy:
+ machine:
+ image: ubuntu-2204:2023.02.1
+ steps:
+ - checkout
+ - run:
+ name: "Deploy to Maven Central"
+ command: source Infrastructure/Build-Scripts/mvn_deploy.sh
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..d2b20ab
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,8 @@
+version: 2
+updates:
+ - package-ecosystem: maven
+ directory: "/"
+ schedule:
+ interval: "weekly"
+ day: "sunday"
+ time: "17:00"
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..c6265fa
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,29 @@
+### Description of Changes
+
+What has been changed? If this is more than bug fixes we should consider incrementing the minor
+version number. For non backwards compatible changes we need to increment the major version number.
+
+### Documentation
+
+Provide links to all relevant documentation that should be updated before asking for the PR to be reviewed. If this section is not relevant please write 'Not Applicable' rather than deleting the section.
+
+### Risks & Impacts
+
+The potential risks of this change as a bullet pointed list and how it might impact the wider sdk. Please consider how easily it would be to rollback these changes if they cause problems. Are there breaking changes?
+
+### Testing
+
+How have the changes been tested and the potential risks mitigated?
+
+### Compare (For layered PRs)
+
+Generate compare URL from https://github.com/ebx/ebx-structuredlogging-sdk/compare so that it's easily accessible. This is ONLY REQUIRED FOR COMPLICATED, DEPENDENT OR LAYERED PRs. Feel free to delete this section if not required.
+
+## Final Checklist
+
+Please tick once completed.
+
+- [ ] Build passes.
+- [ ] Versioning considered (the version number in this PR is inline with semantic
+versioning requirements).
+- [ ] Change log has been updated.
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index a1c2a23..d1ed17f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,8 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
+
+/bin/
+/target/
+.idea/
+*.iml
\ No newline at end of file
diff --git a/.maven.xml b/.maven.xml
new file mode 100644
index 0000000..d954cda
--- /dev/null
+++ b/.maven.xml
@@ -0,0 +1,23 @@
+
+
+
+
+ ossrh
+ ${env.SONATYPE_USERNAME}
+ ${env.SONATYPE_PASSWORD}
+
+
+
+
+
+ ossrh
+
+ true
+
+
+ ${env.GPG_EXECUTABLE}
+ ${env.GPG_PASSPHRASE}
+
+
+
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..026a4d9
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,9 @@
+# ebx-structuredlogging-sdk Changelog
+
+## 1.0.0 (Jan 1, 2014)
+
+* Initial release
+
+## 1.0.1 (May 16, 2024)
+
+* Update dependencies and add dependabot configuration.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..3304f26
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,37 @@
+# Contributing to ebx-structuredlogging-sdk
+
+Contributing code is an essential part of open source and we try to make this as easy as possible. There are several ways you can contribute to ebx-structuredlogging-sdk. Here are some guidelines for creating new issues and sending us pull requests. Please read them carefully before contributing.
+
+## How to create a new issue
+
+We like new issues and are very keen to hear your problems, ideas and proposals. After analyzing them, they are categorized and assigned to a milestone. To make this part easier you should give us some information. Please read the checklist and try to mark as many entries as possible.
+
+**Issue checklist:**
+* Check the closed issues and don't open duplicates
+* Explain your idea or problem in plain English
+* Provide a JSON snippet if possible (values may be obfuscated but similar to the original)
+* Tell us why this is beneficial and what the advantage is for the users
+* Explain your use case, it's easier to understand a proposal if we have some background knowledge
+
+## How to create a pull request
+
+Pull requests (PR) are a very important way to contribute code to the library. We have guidelines for sending us a PR, because changes to the source code are even more fundamental than sending a new issue. This is an overview of our prerequisites.
+
+**PR checklist:**
+* Please ensure you have an associated [github issue](https://github.com/ebx/ebx-structuredlogging-sdk/issues) to hand, this needs to be included in the PR. If a suitable issue doesn't already exist feel free to create one, as described above.
+* The code must be formatted with our code formatter (have a look at the [CodeStyle folder](https://github.com/ebx/ebx-structuredlogging-sdk/tree/master/CodeStyle)). If you perform a local *mvn verify* before creating the PR your changes will already be getting validated for style.
+* The code layout should conform to our general design standards (if you feel it's necessary to go against the grain, please ask us first!).
+* You should complete the PR template and please format your PR title as follows:
+
+ GH-[Issue#] [Summary of change or issue title]
+
+ for example:
+
+ GH-123 Fixed NPE exception when resvoling an organisation
+
+* The pull request should be mergeable, i.e. no conflicts.
+* Junit tests required for any functional change must be included.
+* The pull request should be targetted at the `dev` branch. If you raise it against `master` the PR will fail to build.
+* Please try to keep PR commits in a logical order incase we need to review each commit seperately, but generally speaking the fewer commits the better.
+* Your PR will have to build succesfully against our CI (we use [Travis CI](https://travis-ci.org/ebx/ebx-structuredlogging-sdk)).
+* **Important Note**: If your PR contains breaking changes you must include a MAJOR version bump in the PR.
diff --git a/CodeStyle/Eclipse_EBX_Code_Style_Imports.importorder b/CodeStyle/Eclipse_EBX_Code_Style_Imports.importorder
new file mode 100644
index 0000000..59c42ba
--- /dev/null
+++ b/CodeStyle/Eclipse_EBX_Code_Style_Imports.importorder
@@ -0,0 +1,11 @@
+#Organize Import Order
+#Tue Apr 05 15:57:16 BST 2016
+7=java
+5=sun
+6=io
+4=org
+3=net
+2=mockit
+1=com
+0=sh
+8=javax
diff --git a/CodeStyle/Eclipse_EBX_Code_Style_formatter_settings.xml b/CodeStyle/Eclipse_EBX_Code_Style_formatter_settings.xml
new file mode 100644
index 0000000..5cd9901
--- /dev/null
+++ b/CodeStyle/Eclipse_EBX_Code_Style_formatter_settings.xml
@@ -0,0 +1,295 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CodeStyle/Intellij_EBX_Code_Style_formatter_settings.xml b/CodeStyle/Intellij_EBX_Code_Style_formatter_settings.xml
new file mode 100644
index 0000000..2871283
--- /dev/null
+++ b/CodeStyle/Intellij_EBX_Code_Style_formatter_settings.xml
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CodeStyle/README.md b/CodeStyle/README.md
new file mode 100644
index 0000000..e4add0b
--- /dev/null
+++ b/CodeStyle/README.md
@@ -0,0 +1,100 @@
+FOR ECLIPSE:
+===========
+
+To install the correct formatter settings in Eclipse:
+-----------------------------------------------------
+
+- Window -> Preferences -> Java -> Code style -> Formatter :
+- And then import the file:
+- echobox.main/CodeStyle/"Eclipse_EBX_Code_Style_formatter_settings.XML"
+- Then in the "Organize imports" tab :
+- Window -> Preferences -> Java -> Code style -> Organize imports
+- And then import the file:
+- echobox.main/CodeStyle/"Eclipse_EBX_Code_Style_Imports.importorder"
+
+
+You can now use the formatter by either highlighting the code you want to format, or the entire
+file, and Press ctrl-shift-F. This will automatically format the code so that it complies with the
+EchoBox Style guide.
+
+To format the import statements simply press ctrl-shift-O which will Organize the imports and
+place them in the correct order.
+
+To format code correctly: **Ctrl-Shift-F**
+To format Imports correctly: **Ctrl-Shift-O**
+
+***Use the formatter!!!!***
+
+
+TO Configure the Eclipse "check style" plug-in:
+-----------------------------------------------
+
+When first importing the maven project you should be prompted to install
+the Eclipse "check style" plug-in. This will act as a kind of "compiler" and underline code which
+does not follow the check style standard, allowing you to fix violations as you go.
+
+If you are not prompted to install this plug-in reimport the project.
+
+When the plug-in is installed it defaults to the "Google style guide".
+
+To change this to the "EchoBox style guide":
+
+- Window -> Preferences -> checkStyle :
+- Click : "NEW" on the right-hand side
+- Then in the drop-down menu select "External configuration file"
+- In location select echobox.main/CodeStyle/"checkstyle.xml"
+- you can name this anything, I suggest "EbxStyle".
+- Click : OK
+- Next click on this new configurations and click "Set as default"
+
+Now the Eclipse check style plug-in is configured with the "EchoBox style guide" and should
+behave correctly.
+
+
+
+
+FOR Intellj-IDEA:
+=================
+
+To install the correct formatter settings in Intellj-IDEA:
+----------------------------------------------------------
+
+- File -> Settings -> Code style -> Java , Click: Manage -> import -> Intellj-IDEA code style XML:
+- And then import the file:
+- echobox.main/CodeStyle/"Intellij_EBX_Code_Style_formatter_settings"
+
+
+You can now use the formatter by either highlighting the code you want to format, or the entire
+file, and Press Ctrl-Alt-L. This will automatically format the code so that it complies with the
+EchoBox Style guide.
+
+To format the import statements simply press Ctrl-Alt-O which will optimise the imports and
+place them in the correct order.
+
+To format code correctly: **Ctrl-Alt-L**
+To format Imports correctly: **Ctrl-Alt-O**
+
+***Use the formatter!!!!***
+
+
+TO Configure the Intellj "check style" plug-in:
+------------------------------------------------
+
+to Install the Intellj "check style" plug-in go to:
+
+- Settings -> Plug-ins /
+- Click on the "Browse repositories" button at the bottom.
+- And then enter "CheckStyle-IDEA"
+- Click install
+
+Then to configure this plug-in to conform with "EBXStyle"
+
+- Settings -> Other Settings -> checkstyle
+- click on the green plus button
+- Add in the description "ebx_checks"
+- Add the checkstyle.xml File found in echobox.main\CodeStyle\checkstyle.xml
+- Tick the "Treat checkstyle errors as warnings" box
+- click Apply -> OK
+
+Now any violations of the checkstyle rules will be highlighted as a warning live in the code you
+write.
diff --git a/CodeStyle/checkstyle.xml b/CodeStyle/checkstyle.xml
new file mode 100644
index 0000000..7ed4735
--- /dev/null
+++ b/CodeStyle/checkstyle.xml
@@ -0,0 +1,284 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Infrastructure/Build-Scripts/mvn_deploy.sh b/Infrastructure/Build-Scripts/mvn_deploy.sh
new file mode 100644
index 0000000..018bcc7
--- /dev/null
+++ b/Infrastructure/Build-Scripts/mvn_deploy.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+# shellcheck disable=SC2059
+set -euo pipefail
+##
+# 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.
+##
+
+## For DEV and MASTER deploy to maven central (DEV will deploy a snapshot)
+## All other builds (eg PR builds) are verified by separate script mvn_verify.sh
+export JAVA_HOME="/usr"
+
+get_mvn_version() {
+ mvn help:evaluate -Dexpression=project.version -q -DforceStdout|grep -v '\['
+}
+
+if [ "${CIRCLE_BRANCH}" != "${DEV_BRANCH}" ] && [ "${CIRCLE_BRANCH}" != "${RELEASE_BRANCH}" ]; then
+ # Exit with error if this is not dev or master branch
+ printf "${RED_COLOUR}Deployments to maven central should only be triggered from ${DEV_BRANCH} and ${RELEASE_BRANCH} branches.${NO_COLOUR}\n"
+ exit 1
+else
+ printf "${GREEN_COLOUR}Performing deploy build to maven central.${NO_COLOUR}\n"
+ mvn_version=$(get_mvn_version)
+
+ # If this is not master we dynamically set the version to a snapshot
+ if [ "${CIRCLE_BRANCH}" != "${RELEASE_BRANCH}" ]; then
+ printf "${GREEN_COLOUR}Appending '-SNAPSHOT' to version as this is not the ${RELEASE_BRANCH} branch.${NO_COLOUR}\n"
+ mvn versions:set -q -DnewVersion="${mvn_version}-SNAPSHOT"
+
+ mvn_version=$(get_mvn_version)
+ printf "${GREEN_COLOUR}Build version modified to ${mvn_version}.${NO_COLOUR}\n"
+ fi
+
+ # Ensure the project verison is valid
+ if ! [[ ${mvn_version} =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
+ printf "${RED_COLOUR}The extracted project version '${mvn_version}' was not valid.${NO_COLOUR}\n"
+ exit 1;
+ fi
+
+ echo "${GPG_SECRET_KEYS}" | base64 --decode | $GPG_EXECUTABLE --import --batch --passphrase "${GPG_PASSPHRASE}" || echo "Failed to import GPG_SECRET_KEYS."
+ echo "${GPG_OWNERTRUST}" | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --batch --passphrase "${GPG_PASSPHRASE}" || echo "Failed to import GPG_OWNERTRUST."
+
+ # Deploy to maven central
+ mvn clean deploy --settings .maven.xml -B -U -Prelease
+fi
diff --git a/Infrastructure/Build-Scripts/mvn_verify.sh b/Infrastructure/Build-Scripts/mvn_verify.sh
new file mode 100644
index 0000000..4cd4067
--- /dev/null
+++ b/Infrastructure/Build-Scripts/mvn_verify.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -euo pipefail
+# shellcheck disable=SC2059
+##
+# 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.
+##
+
+## For PR builds, perform maven verify. Exit with error if dev or master
+## as these are handled separately in mvn_deploy.sh
+export JAVA_HOME="/usr"
+
+if [ "$CIRCLE_BRANCH" == "${DEV_BRANCH}" ] || [ "$CIRCLE_BRANCH" == "${RELEASE_BRANCH}" ]; then
+ printf "${RED_COLOUR}ERROR: PR builds should not be triggered by ${DEV_BRANCH} or ${RELEASE_BRANCH} branches.${NO_COLOUR}\n"
+ exit 1
+else
+ printf "${GREEN_COLOUR}Performing a PR verify build on PR #${CIRCLE_PULL_REQUEST##*/}.${NO_COLOUR}\n"
+ java --version
+ mvn clean verify
+fi
diff --git a/Infrastructure/Build-Scripts/validate_build.sh b/Infrastructure/Build-Scripts/validate_build.sh
new file mode 100644
index 0000000..71069e2
--- /dev/null
+++ b/Infrastructure/Build-Scripts/validate_build.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -euo pipefail
+# shellcheck disable=SC2059
+##
+# 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.
+##
+
+if [ "${CIRCLE_BRANCH}" == "${RELEASE_BRANCH}" ] || [ "${CIRCLE_BRANCH}" == "${DEV_BRANCH}" ]; then
+ printf "${GREEN_COLOUR}Building base branch $CIRCLE_BRANCH.${NO_COLOUR}\n"
+else
+ printf "${GREEN_COLOUR}Building PR #${CIRCLE_PULL_REQUEST##*/} '${CIRCLE_PULL_REQUEST}' from branch ${CIRCLE_BRANCH} (into ${DEV_BRANCH})${NO_COLOUR}\n"
+fi
diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 0000000..57f4cf8
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,2 @@
+ebx-structuredlogging-sdk
+Copyright 2020 Echobox
diff --git a/README.md b/README.md
index 05bed27..28b4549 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,100 @@
-# ebx-logging-sdk
-Helpful logging extensions
+[](https://search.maven.org/search?q=g:%22com.echobox%22%20AND%20a:%22ebx-structuredlogging-sdk%22) [](https://raw.githubusercontent.com/ebx/ebx-structuredlogging-sdk/master/LICENSE) [](https://travis-ci.org/ebx/ebx-structuredlogging-sdk)
+# ebx-structuredlogging-sdk
+
+Logging is a critical pillar of service observability. Occasionally it's desirable to
+include structured information and depending on the logging solution these can then be
+more easily graphed, analysed etc, for example with
+[loggly](https://www.loggly.com/blog/introducing-support-for-percentiles-and-other-statistics/).
+
+This library intends to make including such structured logging as easy as possible by allowing
+structured arguments to be included in `ch.qos.logback.classic.net.SyslogAppender`.
+
+## How to use
+
+1. Include this sdk (assuming maven):
+
+```
+
+ com.echobox
+ ebx-structuredlogging-sdk
+ 1.0.0
+
+```
+
+2. Update the relevant project `logback.xml` file to include the extended `SyslogAppender` config:
+
+```
+
+
+
+
+
+localhost
+USER
+[%logger] %nopex
+
+
+
+ { "threadId": "%tid-%thread", "message": "%msg", "exception":"%rEx{30}" }
+
+
+
+
+
+```
+
+The pattern can be modified as required, see [here](http://logback.qos.ch/manual/layouts.html#ClassicPatternLayout).
+
+3. Start including `net.logstash.logback.argument.StructuredArguments` where required:
+
+```
+Map loggingMap = new HashMap<>();
+loggingMap.put("executionTimeMS", endTimeMS - startTimeMS);
+logger.debug("Completed execution in MS {}", StructuredArguments.entries(loggingMap));
+```
+
+or
+
+```
+logger.warn(...
+```
+
+etc.
+
+## Getting in touch
+
+* **[GitHub Issues](https://github.com/ebx/ebx-structuredlogging-sdk/issues/new)**: If you have ideas, bugs,
+or problems with our library, just open a new issue.
+
+## Contributing
+
+If you would like to get involved please follow the instructions
+[here](https://github.com/ebx/ebx-structuredlogging-sdk/tree/master/CONTRIBUTING.md)
+
+## Releases
+
+We use [semantic versioning](https://semver.org/).
+
+All merges into DEV will automatically get released as a maven central snapshot, which can be easily
+included in any downstream dependencies that always desire the latest changes (see above for
+'Most Up To Date' installation).
+
+Each merge into the MASTER branch will automatically get released to Maven central and github
+releases, using the current library version. As such, following every merge to master, the version
+number of the dev branch should be incremented and will represent 'Work In Progress' towards the
+next release.
+
+Please use a merge (not rebase) commit when merging dev into master to perform the release.
+
+To create a full release to Maven central please follow these steps:
+1. Ensure the `CHANGELOG.md` is up to date with all the changes in the release, if not please raise
+a suitable PR into `DEV`. Typically the change log should be updated as we go.
+3. Create a PR from `DEV` into `MASTER`. Ensure the version in the `pom.xml` is the
+correct version to be released. Merging this PR into `MASTER` will automatically create the maven
+and github releases. Please note that a release is final, it can not be undone/deleted/overwritten.
+5. Once the public release has been successful create a final PR into `DEV` that contains an
+incremented `pom.xml` version to ensure the correct snapshot gets updated on subsequent merges
+into `DEV`. This PR should also include:
+ * An update to the `README.md` latest stable release version number.
+ * A 'Work In Progress' entry for the next anticipated release in `CHANGELOG.md`.
\ No newline at end of file
diff --git a/licenseheader.txt b/licenseheader.txt
new file mode 100644
index 0000000..ae6f28c
--- /dev/null
+++ b/licenseheader.txt
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..c2bf5d8
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,255 @@
+
+
+ 4.0.0
+
+ ebx-structuredlogging-sdk
+ ebx-structuredlogging-sdk intends to make including structured logging data as easy as possible.
+ https://github.com/ebx/ebx-structuredlogging-sdk
+
+ com.echobox
+ ebx-structuredlogging-sdk
+ 1.0.1
+ jar
+
+
+ UTF-8
+ UTF-8
+ 1.8
+ 1.8
+
+
+
+
+ Apache License, Version 2.0
+ https://raw.githubusercontent.com/ebx/ebx-structuredlogging-sdk/master/LICENSE
+ repo
+
+
+
+
+ scm:git:https://github.com/ebx/ebx-structuredlogging-sdk
+ https://github.com/ebx/ebx-structuredlogging-sdk
+
+
+
+
+ ossrh
+ https://oss.sonatype.org/content/repositories/snapshots
+
+
+ ossrh
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+
+
+
+ Echobox
+ http://www.echobox.com
+
+
+
+
+
+ org.slf4j
+ slf4j-api
+ 1.7.30
+
+
+ org.slf4j
+ slf4j-ext
+ 1.7.30
+
+
+ ch.qos.logback
+ logback-classic
+ 1.2.13
+
+
+
+ net.logstash.logback
+ logstash-logback-encoder
+ 6.4
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.13.0
+
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.2.5
+
+
+ org.apache.maven.surefire
+ surefire-junit47
+ 3.2.5
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.6.3
+
+
+ attach-javadocs
+ package
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 3.3.1
+
+
+ validate
+ validate
+
+ CodeStyle/checkstyle.xml
+ true
+ true
+ true
+ basedir=${project.basedir}
+
+
+ check
+
+
+
+
+
+ com.puppycrawl.tools
+ checkstyle
+ 8.29
+
+
+ com.github.sevntu-checkstyle
+ sevntu-checks
+ 1.44.1
+
+
+
+
+ org.apache.maven.plugins
+ maven-pmd-plugin
+ 3.22.0
+
+
+ cpd
+ validate
+
+ cpd
+
+
+ 50
+
+
+
+ cpd-check
+ validate
+
+ cpd-check
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+ release
+
+
+ release
+
+
+
+
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ 1.6.13
+ true
+
+ ossrh
+ https://oss.sonatype.org/
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.3.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.6.3
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 3.2.4
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+ --pinentry-mode
+ loopback
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/echobox/logging/SyslogAppenderWithAppendix.java b/src/main/java/com/echobox/logging/SyslogAppenderWithAppendix.java
new file mode 100644
index 0000000..4d67bcd
--- /dev/null
+++ b/src/main/java/com/echobox/logging/SyslogAppenderWithAppendix.java
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+package com.echobox.logging;
+
+import ch.qos.logback.classic.net.SyslogAppender;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Layout;
+
+/**
+ * A variant {@link SyslogAppender} admitting a specified {@code Layout} that will be attached to
+ * the end of each message.
+ *
+ * @author MarcF
+ */
+public class SyslogAppenderWithAppendix extends SyslogAppender {
+ /**
+ * The layout to append to each message.
+ */
+ protected Layout appendixLayout;
+
+ @Override
+ public Layout buildLayout() {
+ // First layout is just the base layout:
+ Layout syslogLayout = super.buildLayout();
+
+ // Second layout comes from this class, probably set in a config file.
+ TwoPartLayout layout = new TwoPartLayout<>(syslogLayout, appendixLayout);
+
+ layout.setContext(getContext());
+ layout.start();
+
+ return layout;
+ }
+
+ /**
+ * Public setter to allow the layout to be set from a config file.
+ *
+ * @param appendixLayout the appendix layout
+ */
+ public void setAppendixLayout(Layout appendixLayout) {
+ this.appendixLayout = appendixLayout;
+ }
+}
diff --git a/src/main/java/com/echobox/logging/ThreadIdConverter.java b/src/main/java/com/echobox/logging/ThreadIdConverter.java
new file mode 100644
index 0000000..a9d1a5d
--- /dev/null
+++ b/src/main/java/com/echobox/logging/ThreadIdConverter.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package com.echobox.logging;
+
+import ch.qos.logback.classic.pattern.ClassicConverter;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+
+/**
+ * A converter used in logging to create a unique thread id
+ *
+ * @author MarcF
+ */
+public class ThreadIdConverter extends ClassicConverter {
+
+ private static int nextId = 0;
+ private static final ThreadLocal threadId = new ThreadLocal() {
+
+ @Override
+ protected String initialValue() {
+ int nextId = nextId();
+ return String.format("%05d", nextId);
+ }
+ };
+
+ private static synchronized int nextId() {
+ nextId = (nextId + 1) % 99999;
+ return nextId;
+ }
+
+ @Override
+ public String convert(ILoggingEvent event) {
+ return threadId.get();
+ }
+}
diff --git a/src/main/java/com/echobox/logging/TwoPartLayout.java b/src/main/java/com/echobox/logging/TwoPartLayout.java
new file mode 100644
index 0000000..6649240
--- /dev/null
+++ b/src/main/java/com/echobox/logging/TwoPartLayout.java
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+
+package com.echobox.logging;
+
+import ch.qos.logback.core.Context;
+import ch.qos.logback.core.Layout;
+import ch.qos.logback.core.LayoutBase;
+
+/**
+ * A wrapper for a pair of Layouts.
+ *
+ * When {@link #doLayout(Object)} is called on an event, it applies each layout to the event and
+ * returns the concatenation of the results.
+ *
+ * @param The type parameter for the Layout
+ *
+ * @author MarcF
+ */
+public class TwoPartLayout extends LayoutBase {
+
+ /**
+ * The first layout, which will make up the beginning of each message.
+ */
+ protected Layout first;
+
+ /**
+ * The second layout, which will make up the end of each message.
+ */
+ protected Layout second;
+
+ /**
+ * Construct a new {@code TwoPartLayout} from the provided {@code Layout}s.
+ *
+ * @param first the first
+ * @param second the second
+ */
+ public TwoPartLayout(Layout first, Layout second) {
+ this.first = first;
+ this.second = second;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see ch.qos.logback.core.Layout#doLayout(java.lang.Object)
+ */
+ @Override
+ public String doLayout(E event) {
+ return first.doLayout(event) + second.doLayout(event);
+ }
+
+ @Override
+ public void setContext(Context context) {
+ first.setContext(context);
+ second.setContext(context);
+ super.setContext(context);
+ }
+
+ @Override
+ public void start() {
+ first.start();
+ second.start();
+ super.start();
+ }
+}