Set/Change list properties in application.properties in Akka
I want to use slf4j for logging, based on logging doc. These config should be changed in application.conf:
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
I'm using application.properties instead of application.conf:
akka.loggers[0]=akka.event.slf4j.Slf4jLogger
akka.logging-filter=akka.event.slf4j.Slf4jLoggingFilter
But above config does not change akka.loggers value (the value is still the default value: akka.event.Logging$DefaultLogger).
Printing all configuration:
"loggers" : [
# reference.conf @ jar:file:/home/user/.m2/repository/com/typesafe/akka/akka-actor_2.12/2.5.18/akka-actor_2.12-2.5.18.jar!/reference.conf: 17
"akka.event.Logging$DefaultLogger"
],
# application.properties @ file:/home/user/workspace/x-platform/target/test-classes/application.properties
"loggers[0]" : "akka.event.slf4j.Slf4jLogger",
# application.properties @ file:/home/user/workspace/x-platform/target/test-classes/application.properties
"logging-filter" : "akka.event.slf4j.Slf4jLoggingFilter",
So my question is: how can i set/change value for a list prpperty in application.properties?
I'm using akka 2.5.18 with Java.
akka typesafe-config application.properties
add a comment |
I want to use slf4j for logging, based on logging doc. These config should be changed in application.conf:
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
I'm using application.properties instead of application.conf:
akka.loggers[0]=akka.event.slf4j.Slf4jLogger
akka.logging-filter=akka.event.slf4j.Slf4jLoggingFilter
But above config does not change akka.loggers value (the value is still the default value: akka.event.Logging$DefaultLogger).
Printing all configuration:
"loggers" : [
# reference.conf @ jar:file:/home/user/.m2/repository/com/typesafe/akka/akka-actor_2.12/2.5.18/akka-actor_2.12-2.5.18.jar!/reference.conf: 17
"akka.event.Logging$DefaultLogger"
],
# application.properties @ file:/home/user/workspace/x-platform/target/test-classes/application.properties
"loggers[0]" : "akka.event.slf4j.Slf4jLogger",
# application.properties @ file:/home/user/workspace/x-platform/target/test-classes/application.properties
"logging-filter" : "akka.event.slf4j.Slf4jLoggingFilter",
So my question is: how can i set/change value for a list prpperty in application.properties?
I'm using akka 2.5.18 with Java.
akka typesafe-config application.properties
add a comment |
I want to use slf4j for logging, based on logging doc. These config should be changed in application.conf:
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
I'm using application.properties instead of application.conf:
akka.loggers[0]=akka.event.slf4j.Slf4jLogger
akka.logging-filter=akka.event.slf4j.Slf4jLoggingFilter
But above config does not change akka.loggers value (the value is still the default value: akka.event.Logging$DefaultLogger).
Printing all configuration:
"loggers" : [
# reference.conf @ jar:file:/home/user/.m2/repository/com/typesafe/akka/akka-actor_2.12/2.5.18/akka-actor_2.12-2.5.18.jar!/reference.conf: 17
"akka.event.Logging$DefaultLogger"
],
# application.properties @ file:/home/user/workspace/x-platform/target/test-classes/application.properties
"loggers[0]" : "akka.event.slf4j.Slf4jLogger",
# application.properties @ file:/home/user/workspace/x-platform/target/test-classes/application.properties
"logging-filter" : "akka.event.slf4j.Slf4jLoggingFilter",
So my question is: how can i set/change value for a list prpperty in application.properties?
I'm using akka 2.5.18 with Java.
akka typesafe-config application.properties
I want to use slf4j for logging, based on logging doc. These config should be changed in application.conf:
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
I'm using application.properties instead of application.conf:
akka.loggers[0]=akka.event.slf4j.Slf4jLogger
akka.logging-filter=akka.event.slf4j.Slf4jLoggingFilter
But above config does not change akka.loggers value (the value is still the default value: akka.event.Logging$DefaultLogger).
Printing all configuration:
"loggers" : [
# reference.conf @ jar:file:/home/user/.m2/repository/com/typesafe/akka/akka-actor_2.12/2.5.18/akka-actor_2.12-2.5.18.jar!/reference.conf: 17
"akka.event.Logging$DefaultLogger"
],
# application.properties @ file:/home/user/workspace/x-platform/target/test-classes/application.properties
"loggers[0]" : "akka.event.slf4j.Slf4jLogger",
# application.properties @ file:/home/user/workspace/x-platform/target/test-classes/application.properties
"logging-filter" : "akka.event.slf4j.Slf4jLoggingFilter",
So my question is: how can i set/change value for a list prpperty in application.properties?
I'm using akka 2.5.18 with Java.
akka typesafe-config application.properties
akka typesafe-config application.properties
edited Nov 24 '18 at 14:40
Robin Green
22.2k875154
22.2k875154
asked Nov 24 '18 at 12:03
unitedunited
1,09332138
1,09332138
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Have you tried this the parseString thing?
val customConf = ConfigFactory.parseString("""
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
""")
val system = ActorSystem("MySystem", ConfigFactory.load(customConf))
or combining custom config with the usual one
Config myConfig =ConfigFactory.parseString("loggers=['akka.event.slf4j.Slf4jLogger']");
Config regularConfig = ConfigFactory.load();
Config combined = myConfig.withFallback(regularConfig);
It doesn't work correctly. thecombineddoes not contain other akka related configs which changed inapplication.properties(but it has the correct value forakka.loggers)
– united
Dec 9 '18 at 13:02
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457949%2fset-change-list-properties-in-application-properties-in-akka%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Have you tried this the parseString thing?
val customConf = ConfigFactory.parseString("""
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
""")
val system = ActorSystem("MySystem", ConfigFactory.load(customConf))
or combining custom config with the usual one
Config myConfig =ConfigFactory.parseString("loggers=['akka.event.slf4j.Slf4jLogger']");
Config regularConfig = ConfigFactory.load();
Config combined = myConfig.withFallback(regularConfig);
It doesn't work correctly. thecombineddoes not contain other akka related configs which changed inapplication.properties(but it has the correct value forakka.loggers)
– united
Dec 9 '18 at 13:02
add a comment |
Have you tried this the parseString thing?
val customConf = ConfigFactory.parseString("""
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
""")
val system = ActorSystem("MySystem", ConfigFactory.load(customConf))
or combining custom config with the usual one
Config myConfig =ConfigFactory.parseString("loggers=['akka.event.slf4j.Slf4jLogger']");
Config regularConfig = ConfigFactory.load();
Config combined = myConfig.withFallback(regularConfig);
It doesn't work correctly. thecombineddoes not contain other akka related configs which changed inapplication.properties(but it has the correct value forakka.loggers)
– united
Dec 9 '18 at 13:02
add a comment |
Have you tried this the parseString thing?
val customConf = ConfigFactory.parseString("""
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
""")
val system = ActorSystem("MySystem", ConfigFactory.load(customConf))
or combining custom config with the usual one
Config myConfig =ConfigFactory.parseString("loggers=['akka.event.slf4j.Slf4jLogger']");
Config regularConfig = ConfigFactory.load();
Config combined = myConfig.withFallback(regularConfig);
Have you tried this the parseString thing?
val customConf = ConfigFactory.parseString("""
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
""")
val system = ActorSystem("MySystem", ConfigFactory.load(customConf))
or combining custom config with the usual one
Config myConfig =ConfigFactory.parseString("loggers=['akka.event.slf4j.Slf4jLogger']");
Config regularConfig = ConfigFactory.load();
Config combined = myConfig.withFallback(regularConfig);
answered Dec 3 '18 at 21:25
Ashfaq AhmedAshfaq Ahmed
1,13331529
1,13331529
It doesn't work correctly. thecombineddoes not contain other akka related configs which changed inapplication.properties(but it has the correct value forakka.loggers)
– united
Dec 9 '18 at 13:02
add a comment |
It doesn't work correctly. thecombineddoes not contain other akka related configs which changed inapplication.properties(but it has the correct value forakka.loggers)
– united
Dec 9 '18 at 13:02
It doesn't work correctly. the
combined does not contain other akka related configs which changed in application.properties (but it has the correct value for akka.loggers)– united
Dec 9 '18 at 13:02
It doesn't work correctly. the
combined does not contain other akka related configs which changed in application.properties (but it has the correct value for akka.loggers)– united
Dec 9 '18 at 13:02
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457949%2fset-change-list-properties-in-application-properties-in-akka%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown