mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 02:05:56 +01:00
Fix logging on installed app
This commit is contained in:
173
pom.xml
173
pom.xml
@@ -16,18 +16,61 @@
|
|||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>windows</id>
|
<id>portable</id>
|
||||||
<activation>
|
|
||||||
<os>
|
|
||||||
<family>windows</family>
|
|
||||||
</os>
|
|
||||||
</activation>
|
|
||||||
<build>
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>log4j2.yml</include>
|
||||||
|
<include>log4j2-debug.yml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>3.3.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>archive</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>maven/assembly.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>windows</id>
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>log4j2-installed.yaml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.3.1</version>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.panteleyev</groupId>
|
<groupId>org.panteleyev</groupId>
|
||||||
<artifactId>jpackage-maven-plugin</artifactId>
|
<artifactId>jpackage-maven-plugin</artifactId>
|
||||||
<version>1.4.0</version>
|
<version>1.6.5</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>windows</id>
|
<id>windows</id>
|
||||||
@@ -37,6 +80,9 @@
|
|||||||
<winConsole>true</winConsole>
|
<winConsole>true</winConsole>
|
||||||
<winShortcut>false</winShortcut>
|
<winShortcut>false</winShortcut>
|
||||||
<winMenu>false</winMenu>
|
<winMenu>false</winMenu>
|
||||||
|
<javaOptions>
|
||||||
|
<javaOption>-Dlog4j.configurationFile=log4j2-installed.yaml</javaOption>
|
||||||
|
</javaOptions>
|
||||||
</configuration>
|
</configuration>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
<goals>
|
<goals>
|
||||||
@@ -50,11 +96,6 @@
|
|||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>linux</id>
|
<id>linux</id>
|
||||||
<activation>
|
|
||||||
<os>
|
|
||||||
<family>linux</family>
|
|
||||||
</os>
|
|
||||||
</activation>
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@@ -88,9 +129,6 @@
|
|||||||
<sourceDirectory>src/main/java</sourceDirectory>
|
<sourceDirectory>src/main/java</sourceDirectory>
|
||||||
<testSourceDirectory>src/test/java</testSourceDirectory>
|
<testSourceDirectory>src/test/java</testSourceDirectory>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
<resource>
|
||||||
<directory>./</directory>
|
<directory>./</directory>
|
||||||
<includes>
|
<includes>
|
||||||
@@ -178,68 +216,53 @@
|
|||||||
</annotationProcessorPaths>
|
</annotationProcessorPaths>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>3.3.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>copy-jpackage-input</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy-resources</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.build.directory}/jpackage-input</outputDirectory>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>${project.build.directory}</directory>
|
|
||||||
<includes>
|
|
||||||
<include>${project.artifactId}-${project.version}.jar</include>
|
|
||||||
</includes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<version>3.3.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>archive</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>single</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
|
||||||
<descriptors>
|
|
||||||
<descriptor>maven/assembly.xml</descriptor>
|
|
||||||
</descriptors>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.panteleyev</groupId>
|
|
||||||
<artifactId>jpackage-maven-plugin</artifactId>
|
|
||||||
<version>1.4.0</version>
|
|
||||||
<configuration>
|
|
||||||
<name>${project.artifactId}</name>
|
|
||||||
<vendor>RatzzFatzz</vendor>
|
|
||||||
<appVersion>${project.version}</appVersion>
|
|
||||||
|
|
||||||
<destination>target/installer</destination>
|
|
||||||
|
|
||||||
<input>target/jpackage-input</input>
|
|
||||||
<mainClass>at.pcgamingfreaks.mkvaudiosubtitlechanger.Main</mainClass>
|
|
||||||
<mainJar>${project.artifactId}-${project.version}.jar</mainJar>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.3.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-jpackage-input</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/jpackage-input</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<includes>
|
||||||
|
<include>${project.artifactId}-${project.version}.jar</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.panteleyev</groupId>
|
||||||
|
<artifactId>jpackage-maven-plugin</artifactId>
|
||||||
|
<version>1.4.0</version>
|
||||||
|
<configuration>
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<vendor>RatzzFatzz</vendor>
|
||||||
|
<appVersion>${project.version}</appVersion>
|
||||||
|
|
||||||
|
<destination>target/installer</destination>
|
||||||
|
|
||||||
|
<input>target/jpackage-input</input>
|
||||||
|
<mainClass>at.pcgamingfreaks.mkvaudiosubtitlechanger.Main</mainClass>
|
||||||
|
<mainJar>${project.artifactId}-${project.version}.jar</mainJar>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
|||||||
@@ -7,13 +7,17 @@ Configuration:
|
|||||||
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
|
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
|
||||||
ThresholdFilter:
|
ThresholdFilter:
|
||||||
level: debug
|
level: debug
|
||||||
File:
|
RollingFile:
|
||||||
name: FileAppender
|
name: FileAppender
|
||||||
fileName: default.log
|
fileName: logs/application.log
|
||||||
|
filePattern: logs/archive/application-%d{yyyy-MM-dd}-%i.log
|
||||||
PatternLayout:
|
PatternLayout:
|
||||||
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
|
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
|
||||||
ThresholdFilter:
|
ThresholdFilter:
|
||||||
level: debug
|
level: debug
|
||||||
|
Policies:
|
||||||
|
OnStartupTriggeringPolicy:
|
||||||
|
minSize: 0
|
||||||
Loggers:
|
Loggers:
|
||||||
Root:
|
Root:
|
||||||
level: debug
|
level: debug
|
||||||
|
|||||||
31
src/main/resources/log4j2-installed.yaml
Normal file
31
src/main/resources/log4j2-installed.yaml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
Configuration:
|
||||||
|
name: DefaultLogger
|
||||||
|
Appenders:
|
||||||
|
File:
|
||||||
|
name: FileAppender
|
||||||
|
fileName: ${sys:user.home}/AppData/Roaming/MyApplication/MyApplication.log
|
||||||
|
PatternLayout:
|
||||||
|
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
|
||||||
|
ThresholdFilter:
|
||||||
|
level: info
|
||||||
|
RollingFile:
|
||||||
|
name: FileAppender
|
||||||
|
fileName: ${sys:user.home}/AppData/Roaming/MKVAudioSubtitleChanger/logs/application.log
|
||||||
|
filePattern: ${sys:user.home}/AppData/Roaming/MKVAudioSubtitleChanger/logs/archive/application-%d{yyyy-MM-dd}-%i.log
|
||||||
|
PatternLayout:
|
||||||
|
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
|
||||||
|
ThresholdFilter:
|
||||||
|
level: info
|
||||||
|
Policies:
|
||||||
|
OnStartupTriggeringPolicy:
|
||||||
|
minSize: 0
|
||||||
|
Loggers:
|
||||||
|
Root:
|
||||||
|
level: info
|
||||||
|
AppenderRef:
|
||||||
|
- ref: FileAppender
|
||||||
|
Logger:
|
||||||
|
name: "com.zaxxer.hikari.HikariConfig"
|
||||||
|
level: info
|
||||||
|
AppenderRef:
|
||||||
|
- ref: FileAppender
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
Configuration:
|
Configuration:
|
||||||
name: DefaultLogger
|
name: DefaultLogger
|
||||||
Appenders:
|
Appenders:
|
||||||
File:
|
RollingFile:
|
||||||
name: FileAppender
|
name: FileAppender
|
||||||
fileName: default.log
|
fileName: logs/application.log
|
||||||
|
filePattern: logs/archive/application-%d{yyyy-MM-dd}-%i.log
|
||||||
PatternLayout:
|
PatternLayout:
|
||||||
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
|
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
|
||||||
ThresholdFilter:
|
ThresholdFilter:
|
||||||
level: info
|
level: info
|
||||||
|
Policies:
|
||||||
|
OnStartupTriggeringPolicy:
|
||||||
|
minSize: 0
|
||||||
Loggers:
|
Loggers:
|
||||||
Root:
|
Root:
|
||||||
level: info
|
level: info
|
||||||
|
|||||||
Reference in New Issue
Block a user