Skip to content

Commit

Permalink
Merge pull request #30 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Aug 19, 2020
2 parents d362dd0 + 7db2ea1 commit 0104140
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 25 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ on:
branches:
- master
- v4-hotfix
paths-ignore:
- '.github/**'
- README.md
- README_TEMPLATE.md
- gradle.properties
- CHANGELOG.md

env:
VERSION_FILE: gradle.properties
Expand Down Expand Up @@ -61,6 +67,13 @@ jobs:
-Prelease.newVersion=${{env.NEXT_VERSION}} -PbintrayUser=${{secrets.BINTRAY_USER}} -PbintrayApiKey=${{secrets.BINTRAY_API_KEY}} \
-PgithubUserName=${{env.GH_USER_NAME}} -PgithubToken=${{secrets.GITHUB_TOKEN}}
- name: Read changelog Entry
id: readChangelogEntry
uses: mindsers/changelog-reader-action@v1.2.0
with:
version: 'Unreleased'
path: ./${{ env.CHANGE_LOG_FILE }}

- name: Update CHANGELOG.md
id: changelogUpdate
run: |
Expand All @@ -75,13 +88,6 @@ jobs:
git commit -m "Changelog update"
git push
- name: Read changelog Entry
id: readChangelogEntry
uses: mindsers/changelog-reader-action@v1.2.0
with:
version: ${{ env.RELEASE_VERSION }}
path: ./${{ env.CHANGE_LOG_FILE }}

- name: Create Release
id: createRelease
uses: actions/create-release@v1
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## [Unreleased]
### Changed
- bumping up client version
### Fixed
- Workarounded: A multi-threaded bug in Log4j 1.2 log formatting. When a log line mixes with
other nearest log lines. This fix affects logger performance, so it's common recommendation to
avoid using Log4j 1.2

## [5.0.2]
### Changed
Expand Down
17 changes: 8 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'java'
}
apply plugin: 'java-library'

project.ext.releaseMode = project.hasProperty('releaseMode')

def branch = releaseMode ? '5.0.0' : 'develop'
Expand Down Expand Up @@ -32,11 +31,11 @@ publishing {
}

dependencies {
compile 'com.epam.reportportal:client-java:5.0.2'
compile 'com.epam.reportportal:commons-model:5.0.0'
compileOnly 'log4j:log4j:1.2.17'
compileOnly 'org.apache.logging.log4j:log4j-api:2.13.0'
compileOnly 'org.apache.logging.log4j:log4j-core:2.13.0'
implementation 'com.epam.reportportal:client-java:5.0.6'
implementation 'com.epam.reportportal:commons-model:5.0.0'
implementation 'log4j:log4j:1.2.17'
implementation 'org.apache.logging.log4j:log4j-api:2.13.0'
implementation 'org.apache.logging.log4j:log4j-core:2.13.0'
}

wrapper {
Expand All @@ -45,4 +44,4 @@ wrapper {

def releaseDependencies = [bintrayUpload, publish]
releaseDependencies.addAll(afterReleaseBuild.getDependsOn())
//afterReleaseBuild.setDependsOn(releaseDependencies)
afterReleaseBuild.setDependsOn(releaseDependencies)
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
import com.epam.reportportal.message.ReportPortalMessage;
import com.epam.ta.reportportal.ws.model.log.SaveLogRQ;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Layout;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.spi.LoggingEvent;
import rp.com.google.common.base.Throwables;

import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.UUID;
import java.util.function.Function;

import static com.epam.reportportal.service.ReportPortal.emitLog;

Expand All @@ -43,7 +44,7 @@ protected void append(final LoggingEvent event) {
return;
}

emitLog((Function<String, SaveLogRQ>) itemUuid -> {
emitLog(itemUuid -> {
SaveLogRQ request = new SaveLogRQ();
request.setLevel(event.getLevel().toString());
request.setLogTime(new Date(event.getTimeStamp()));
Expand Down Expand Up @@ -88,10 +89,15 @@ protected void append(final LoggingEvent event) {

} else {
// Plain string message is reported
if (ReportPortalAppender.this.layout == null) {
Layout myLayout = getLayout();
if (myLayout == null) {
logMessage = event.getRenderedMessage();
} else {
logMessage = ReportPortalAppender.this.layout.format(event).concat(throwable.toString());
if (myLayout instanceof PatternLayout) {
// a Log4j 1.2 multi-threaded bug workaround
myLayout = new PatternLayout(((PatternLayout) myLayout).getConversionPattern());
}
logMessage = myLayout.format(event).concat(throwable.toString());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.io.Serializable;
import java.util.Date;
import java.util.UUID;
import java.util.function.Function;

import static com.epam.reportportal.service.ReportPortal.emitLog;
import static com.epam.reportportal.utils.MimeTypeDetector.detect;
Expand All @@ -48,6 +47,7 @@
* @author Dzmitry_Kavalets
*/
@Plugin(name = "ReportPortalLog4j2Appender", category = "Core", elementType = "appender", printObject = true)
@SuppressWarnings("unused")
public class ReportPortalLog4j2Appender extends AbstractAppender {

protected ReportPortalLog4j2Appender(String name, Filter filter, Layout<? extends Serializable> layout) {
Expand Down Expand Up @@ -78,7 +78,7 @@ public void append(final LogEvent logEvent) {
return;
}

emitLog((Function<String, SaveLogRQ>) itemUuid -> {
emitLog(itemUuid -> {
SaveLogRQ request = new SaveLogRQ();
request.setItemUuid(itemUuid);
request.setLogTime(new Date(event.getTimeMillis()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
import com.epam.reportportal.message.HashMarkSeparatedMessageParser;
import com.epam.reportportal.message.MessageParser;

import java.util.Arrays;
import java.util.List;

/**
* @author Andrei Varabyeu
*/
Expand Down

0 comments on commit 0104140

Please sign in to comment.