Skip to content

Commit 7482763

Browse files
committed
Initial version
1 parent 7b29251 commit 7482763

19 files changed

+1678
-2
lines changed

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
*.class
2+
3+
# Mobile Tools for Java (J2ME)
4+
.mtj.tmp/
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
12+
hs_err_pid*
13+
14+
# Eclipse
15+
.classpath
16+
.project
17+
.settings/
18+
19+
# Intellij
20+
.idea/
21+
*.iml
22+
*.iws
23+
24+
# Mac
25+
.DS_Store
26+
27+
# Maven
28+
log/
29+
target/
30+
31+
# General
32+
disabled
33+
34+
# Jenkins
35+
Jenkins/*/builds
36+
Jenkins/*/lastStable
37+
Jenkins/*/lastSuccessful
38+
Jenkins/*/nextBuildNumber
39+
Jenkins/*/scm-polling.log

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: java
2+
3+
jdk:
4+
- openjdk15
5+
6+
script:
7+
- mvn test -B
8+
9+
before_deploy:
10+
- POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
11+
12+
# Releases config copied from https://docs.travis-ci.com/user/deployment/releases/ and secure key generated by following
13+
# https://stackoverflow.com/questions/25302518/travis-ci-setup-releases-with-github-token#answer-57032190
14+
deploy:
15+
provider: releases
16+
api_key:
17+
secure: laB7B7A4PPm3XWTAdmp+2jaQXA1tyzC8LRZjKAcz7AuIfMlVVvp1O42/mnkewtlLQemyzqTJWImvZ7D+KrAQLdmgmDZjq0hZQy9an0woKBe+loMtqmGToRi+UpGJKv0Kzq4DpBBIRreqokxW5yNId9Q25QI8gEuI5irM0w/rehV12NnyHE+w08UbXS8WO6HfE0KmOR5ncKL7gR7NVOees3nCYCsw3nI8Y0DwjkFMdpqH5rqnGk+qW4P+3U58xvUTrna3NKJ9lLo6lPOnwAGS5E8u8UtZ2Xx0tgsXSBRdbPimZpkTB+nrSyORwpNPjntkfFZH6+vLPN0xLf7/bUB2bGEpVxEbCBTV0CeQCrxh04esj0tN1ANCObISA8ZFH4020xh+OYR93JVAcJMJLHIT73bVKXh5Sv8Q0v99VJP6hmZHQFtL/l68Pmf8wTYH9E/2Akxi9ytSYojZTZh4zkiXTS7dPRfoxkvGSTy8S77nS6mtZHQm0UyKS+o6dq0VHqpWkoY8NijrPCg/a+qXDpCF532eBYDLxZQIFEdVFmF+kg4fpx63oL/03JkU9P3zptVhWbk4qkuad8HuVIC5p9R04f89KHT5wUNabWBhFP/6O0M6X48ukI359jwYbbNz8WYg5HkBZwvGlzVgzLJ9OFESRaDZ83mf5+uDz7LWcBT52GM=
18+
file: "target/spt-development-logging-spring-${POM_VERSION}.jar"
19+
skip_cleanup: true
20+
on:
21+
tags: true

README.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,58 @@
1-
# spt-development-logging-spring
2-
Library for adding logging to public @RestController, @Service and @Repository class methods and @JmsListener methods.
1+
````
2+
____ ____ _____ ____ _ _
3+
/ ___|| _ \_ _| | _ \ _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_
4+
\___ \| |_) || | | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __|
5+
___) | __/ | | | |_| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_
6+
|____/|_| |_| |____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__|
7+
|_|
8+
logging-spring -----------------------------------------------------------------
9+
````
10+
11+
[![build_status](https://travis-ci.com/spt-development/spt-development-logging-spring.svg?branch=main)](https://travis-ci.com/spt-development/spt-development-logging-spring)
12+
13+
A library for adding logging (at the start, end and on exception) to public methods of classes annotated with
14+
`@RestController`, `@Service` or `@Repository` or methods annotated with `@JmsListener`.
15+
16+
Usage
17+
=====
18+
19+
Register the Aspects as Spring Beans manually or by adding the
20+
[spt-development/spt-development-logging-spring-boot](https://github.com/spt-development/spt-development-logging-spring-boot)
21+
starter to your project's pom.
22+
23+
@Bean
24+
public RestControllerLogger restControllerLogger() {
25+
return new RestControllerLogger();
26+
}
27+
28+
@Bean
29+
public JmsListenerLogger jmsListenerLogger() {
30+
return new JmsListenerLogger();
31+
}
32+
33+
@Bean
34+
public ServiceLogger serviceLogger() {
35+
return new ServiceLogger();
36+
}
37+
38+
@Bean
39+
public RepositoryLogger repositoryLogger() {
40+
return new RepositoryLogger();
41+
}
42+
43+
Building locally
44+
================
45+
46+
To build the library, run the following maven command:
47+
48+
$ mvn clean install
49+
50+
Release
51+
=======
52+
53+
To build a release and upload to Maven Central run the following maven command:
54+
55+
$ export GPG_TTY=$(tty) # Required on Mac OS X
56+
$ mvn deploy -DskipTests -Prelease
57+
58+
NOTE. This is currently a manual step as not currently integrated into the build.

findbugs-exclude.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<FindBugsFilter>
2+
<!-- Should be resolved by client applications replacing \r\n in log message config -->
3+
<Match>
4+
<Bug pattern="CRLF_INJECTION_LOGS" />
5+
</Match>
6+
7+
<!-- Classes used to log the name of the method being called and its arguments -->
8+
<Match>
9+
<Class name="com.spt.development.logging.spring.JmsListenerLogger" />
10+
<Bug pattern="SLF4J_SIGN_ONLY_FORMAT" />
11+
</Match>
12+
<Match>
13+
<Class name="com.spt.development.logging.spring.RepositoryLogger" />
14+
<Bug pattern="SLF4J_SIGN_ONLY_FORMAT" />
15+
</Match>
16+
<Match>
17+
<Class name="com.spt.development.logging.spring.RestControllerLogger" />
18+
<Bug pattern="SLF4J_SIGN_ONLY_FORMAT" />
19+
</Match>
20+
<Match>
21+
<Class name="com.spt.development.logging.spring.ServiceLogger" />
22+
<Bug pattern="SLF4J_SIGN_ONLY_FORMAT" />
23+
</Match>
24+
</FindBugsFilter>

maven-version-rules.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" comparisonMethod="maven" xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
3+
<ignoreVersions>
4+
<!-- Ignore Alpha’s, Beta’s, release candidates and milestones -->
5+
<ignoreVersion type="regex">(?i).*Alpha(?:-?\d+)?</ignoreVersion>
6+
<ignoreVersion type="regex">(?i).*Beta(?:-?\d+)?</ignoreVersion>
7+
<ignoreVersion type="regex">(?i).*-B(?:-?\d+)?</ignoreVersion>
8+
<ignoreVersion type="regex">(?i).*RC(?:[-\.]?\d+)?</ignoreVersion>
9+
<ignoreVersion type="regex">(?i).*CR(?:-?\d+)?</ignoreVersion>
10+
<ignoreVersion type="regex">(?i).*M(?:-?\d+)?</ignoreVersion>
11+
<ignoreVersion type="regex">(?i).*pr(?:-?\d+)?</ignoreVersion>
12+
</ignoreVersions>
13+
14+
<rules>
15+
</rules>
16+
</ruleset>

0 commit comments

Comments
 (0)