Skip to content

Commit

Permalink
Merge pull request #20 from romanpierson/feature/generalImprovements
Browse files Browse the repository at this point in the history
Feature/general improvements
  • Loading branch information
romanpierson authored Jan 13, 2024
2 parents 0148fba + 621bac9 commit 6abc15c
Show file tree
Hide file tree
Showing 49 changed files with 423 additions and 309 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,16 @@
(2023-11-10)

* Headers case insensitive
* Upgrade to latest versions
* Upgrade to latest versions

### 1.7.0

(2024-01-13)

* Native handling of values
* All Log Elements return now native objects if possible
* String based Appenders have to stringify themselves
* Appenders that understand native objects benefit from this change
* **BREAKING CHANGE**: `Appender.push` signature changed and simplified - only relevant if you have a custom Appender
* Upgrade to Vert.x 4.5.1 -> Ready for Virtual Threads
* Automatic injection of `timestamp` for `ElasticSearchAppender` - no need anymore to define it artifically in logPattern
14 changes: 9 additions & 5 deletions ES_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@ As configuration is now done by plain JsonObject its very simple to use and inje
```yaml
configurations:
- identifier: accesslog-plain
logPattern: "%{msec}t %D cs-uri"
logPattern: "%D cs-uri"
appenders:
- appenderClassName : com.mdac.vertx.web.accesslogger.appender.elasticsearch.impl.ElasticSearchAppender
- appenderClassName : com.romanpierson.vertx.web.accesslogger.appender.elasticsearch.impl.ElasticSearchAppender
config:
instanceIdentifier: accesslog
fieldNames:
- timestamp
- duration
- uri
```
## Conventions
By default all log elements configured will be sent to the indexer to be interpreted as message to be indexed. However the timestamp is passed to the indexer as meta data as the indexer potentially requires that raw value eg to determinate the target index name.
By default you should put as first element plain timestamp %{msec} and the appender will remove that element from the message sent to the indexer.
The instance identifier tells the indexer verticle to what ES instance the data should be indexed. All the detailed configuration of this is done directly on the indexer verticle itself (so the appender does not have to know about this).
## Timestamp
The timestamp value is automatically added - there is no need to add this on the logPattern.
The real fieldname used in the indexer for the ES timestamp field is configured in the indexer verticle itself.
## Field Names Definition
As for each field to be indexed a specific name needs to be used this has to be explicitly set by configuration property `fieldNames`. Be aware that you need to put a name for all fields of your logpattern even for eg the timestamp one that is actually skipped at the end. The real fieldname used in the indexer for the ES timestamp field is configured in the indexer verticle itself.
As for each field to be indexed a specific name needs to be used this has to be explicitly set by configuration property `fieldNames`. Be aware that you need to put a name for all fields of your logpattern.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016-2023 Roman Pierson
Copyright 2016-2024 Roman Pierson

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ Just add it as a dependency to your project (gradle example)

```xml
dependencies {
compile 'com.romanpierson:vertx-web-accesslog:1.6.0'
compile 'com.romanpierson:vertx-web-accesslog:1.7.0'
}
```

## Compatibility with Vertx core

Accesslog version | Vertx version
----|------
1.7.0 | 4.5.1 >
1.6.0 | 4.3.0 >
1.5.0 | 4.2.0 >
1.4.0 | 4.0.0 - 4.1.x
Expand Down
18 changes: 10 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ plugins {
id 'java'
id 'maven-publish'
id 'jacoco'
id "org.sonarqube" version "4.0.0.2929"
id "org.sonarqube" version "4.4.1.3373"
}

repositories {
mavenCentral()
}

ext{
vertxVersion = '4.5.0'
vertxVersion = '4.5.1'
jupiterVersion = '5.10.1'
jupiterLauncherVersion = '1.10.1'
slfApiVersion = '2.0.9'
Expand Down Expand Up @@ -39,10 +39,12 @@ test {
finalizedBy jacocoTestReport
}

sourceCompatibility='1.8'
targetCompatibility='1.8'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

jar.archiveFileName = "vertx-web-accesslog-1.6.1.jar"
jar.archiveFileName = "vertx-web-accesslog-1.7.0.jar"

java {
withSourcesJar()
Expand All @@ -52,9 +54,9 @@ publishing {
publications {
mavenJava(MavenPublication) {

groupId 'com.mdac'
groupId 'com.romanpierson'
artifactId 'vertx-web-accesslog'
version '1.6.1'
version '1.7.0'

from components.java

Expand All @@ -79,6 +81,6 @@ jacocoTestReport {
}

wrapper() {
gradleVersion = '8.0.2'
gradleVersion = '8.5'
}

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 6abc15c

Please sign in to comment.