https://github.com/turquoisespace/throwable-utility
Java JSON Utility for Throwable Exception and Error
https://github.com/turquoisespace/throwable-utility
aws cloud datadog error exception gradle java json logging maven splunk throwable utility
Last synced: 8 days ago
JSON representation
Java JSON Utility for Throwable Exception and Error
- Host: GitHub
- URL: https://github.com/turquoisespace/throwable-utility
- Owner: TurquoiseSpace
- License: apache-2.0
- Created: 2018-11-24T13:09:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-14T08:24:25.000Z (over 2 years ago)
- Last Synced: 2025-01-21T20:11:38.488Z (about 1 year ago)
- Topics: aws, cloud, datadog, error, exception, gradle, java, json, logging, maven, splunk, throwable, utility
- Language: Java
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Throwable Utility

Java's Throwable JSON Transformer Module
[](https://repo1.maven.org/maven2/com/github/TurquoiseSpace/throwable-utility/)
[](https://javadoc.io/doc/com.github.TurquoiseSpace/throwable-utility)
[](https://repo1.maven.org/maven2/com/github/TurquoiseSpace/throwable-utility/)
[](https://repo1.maven.org/maven2/com/github/TurquoiseSpace/throwable-utility/0.0.9/)
[Maven Central Sonatype Search](https://central.sonatype.com/artifact/com.github.TurquoiseSpace/throwable-utility)
[MVN Repository](https://mvnrepository.com/artifact/com.github.TurquoiseSpace/throwable-utility)
[Nexus Repository Manager](https://oss.sonatype.org/#nexus-search;quick~throwable-utility)
## Include as Dependency
- Maven
```
com.github.TurquoiseSpace
throwable-utility
0.0.9
```
- Gradle
```
implementation group: 'com.github.TurquoiseSpace', name: 'throwable-utility', version: '0.0.9'
```
- Gradle (Short)
```
implementation 'com.github.TurquoiseSpace:throwable-utility:0.0.9'
```
- Gradle (Kotlin)
```
implementation("com.github.TurquoiseSpace:throwable-utility:0.0.9")
```
## Code Usage
- Import the class
```
import com.TurquoiseSpace.utility.ExceptionLogUtil;
```
- Call one of the static methods
```
ExceptionLogUtil.logException(exception);
```
```
String exceptionJson = ExceptionLogUtil.getExceptionJson(exception);
```
## Description
The main Utility class `ExceptionLogUtil.java` actually logs the Exception in JSON format, for better readibilty, or gives the Throwable JSON.
The other Utility class `JsonUtil.java` is meant for mapping any Object to JSON, or vice versa.
Can be easily viewed in AWS Cloud Watch or DataDog or Splunk.
Easy to search, by providing whole paragraph of Exception log in one single line.
## KeyWords for searching in Application Logs
```
Encountered Throwable
```
```
Parsed Throwable
```
```
exceptionTraceHeirarchy
```
```
exceptionMeta
```
## Structure of the Repository
The actual code is located inside
./src/main/java/
with the base package as
com.TurquoiseSpace
and child packages (shows the call heirarchy from top to bottom)
and in java files
utility
ExceptionLogUtil.java
ThrowableLogUtil.java
JsonUtil.java
constant
ExceptionConstants.java
ErrorConstants.java
ThrowableConstants.java
model
GenericException.java
ExceptionMeta.java
ExceptionPoint.java
## GPG Keys
- Check existing GPG Keys
```
gpg --list-secret-keys --keyid-format LONG
```
- Generate GPG Key
```
gpg --gen-key
```
- Receive GPG Key from Servers
```
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 876A6DD3FB3573F1
gpg --keyserver hkp://keys.openpgp.org --recv-keys 876A6DD3FB3573F1
gpg --keyserver hkp://pgp.mit.edu --recv-keys 876A6DD3FB3573F1
```
- Send GPG Key to Servers
```
gpg --keyserver hkp://keyserver.ubuntu.com --send-keys 876A6DD3FB3573F1
gpg --keyserver hkp://keys.openpgp.org --send-keys 876A6DD3FB3573F1
gpg --keyserver hkp://pgp.mit.edu --send-keys 876A6DD3FB3573F1
```
## Build
- Normal Sanity
```
mvn -Dmaven.artifact.threads=25 clean eclipse:eclipse -DdownloadSources=true dependency:go-offline dependency:resolve-plugins install -e
```
- With OSSRH Sonatype
```
mvn -Dmaven.artifact.threads=25 clean eclipse:eclipse -DdownloadSources=true dependency:go-offline install --settings /home/mafia/.m2/setting.xml --global-settings /space/tools/apache-maven-3.6.3/conf/settings.xml
```
## Publish Artifact
```
mvn deploy --settings /home/mafia/.m2/setting.xml --global-settings /space/tools/apache-maven-3.6.3/conf/settings.xml
```