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 LOG_LEVEL env var to control default miner log level without editing the logger file #959

Merged
merged 2 commits into from
Dec 23, 2024
Merged
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
17 changes: 16 additions & 1 deletion miner/docs/modules/ROOT/pages/installation/docker.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,19 @@ If you have 2FA enabled or using selenium, you'll have to enter information in t

As Docker doesn't give an interactive shell by default you'll have to run the container in interactive mode yourself the first time.
More can be read about it in link:https://github.com/RakambdaOrg/ChannelPointsMiner/issues/87#issuecomment-988276214[#87].
====
====

[cols=3*]
|===
|Key
|Default
|Description

|LOG_LEVEL
|info
|Sets the log level of the miner (if the default config file is still used)

|LOG_TO_FILE
|
|If set to `true`, logs will also be produced in lo files that are in `/usr/src/app/logs`
|===
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import lombok.extern.log4j.Log4j2;
import org.jetbrains.annotations.NotNull;

@JsonTypeName("mostUsers")
@JsonTypeName("constant")
@Getter
@EqualsAndHashCode
@ToString
Expand Down
4 changes: 2 additions & 2 deletions miner/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
</RollingFile>

<Routing name="router">
<Routes pattern="\$\${env:LOG_TO_FILE}">
<Routes pattern="\${env:LOG_TO_FILE}">
<Route ref="file" key="TRUE"/>
</Routes>
</Routing>
</Appenders>
<Loggers>
<Logger level="info" name="fr.rakambda.channelpointsminer.miner" additivity="false">
<Logger level="\${env:LOG_LEVEL:-info}" name="fr.rakambda.channelpointsminer.miner" additivity="false">
<AppenderRef ref="console"/>
<AppenderRef ref="router"/>
</Logger>
Expand Down
Loading