Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log4j logging #388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion metafix-runner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ dependencies {
application {
mainClass = 'org.metafacture.runner.Flux'

applicationDefaultJvmArgs = [
"-Dorg.metafacture.metafix.logLevel=INFO"
]

if (project.hasProperty('profile')) {
def file = project.getProperty('profile') ?: project.name
def depth = project.hasProperty('profile.depth') ? project.getProperty('profile.depth') : 8

applicationDefaultJvmArgs = [
applicationDefaultJvmArgs += [
"-XX:FlightRecorderOptions=stackdepth=${depth}",
"-XX:StartFlightRecording=dumponexit=true,filename=${file}.jfr,settings=profile"
]
Expand Down
18 changes: 18 additions & 0 deletions metafix/src/main/resources/log4j.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">

<log4j:configuration>
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%-5p [%t] [%c{1}] %m%n" />
</layout>
</appender>

<root>
<priority value="${org.metafacture.metafix.logLevel}" />
<appender-ref ref="stdout" />
</root>

</log4j:configuration>