Comments (2)
I have made a few changes to be able to choose the facility using an env var, and if not set use the default "user".
Later I want to change that for a more parameter solution, using what you propose above, and been able to choose between syslog, stdout and any other logging driver.
Here is what a would apply first:
diff --git a/bin/marathon-framework b/bin/marathon-framework
index 85858a7..7a6d333 100755
--- a/bin/marathon-framework
+++ b/bin/marathon-framework
@@ -20,6 +20,7 @@ self="$(cd "$(dirname "$0")" && pwd -P)"/"$(basename "$0")"
marathon_jar="$self"
conf_dir=/etc/marathon/conf
conf_file=/etc/default/marathon
+syslog_facility=${MARATHON_SYSLOG_FACILITY:-user}
function main {
if [[ ${1:-} = --jar ]]
@@ -60,7 +61,7 @@ function load_options_and_log {
set -o allexport
[[ ! -f "$conf_file" ]] || . "$conf_file"
set +o allexport
- for env_op in `env | grep ^MARATHON_ | sed -e '/^MARATHON_APP/d' -e 's/MARATHON_//' -e 's/=/ /'| awk '{printf("%s%s ", "--", tolower($1)); for(i=2;i<=NF;i++){printf("%s ", $i)}}'| sed -e 's/ $//'`; do
+ for env_op in `env | grep ^MARATHON_ | grep -v MARATHON_SYSLOG_FACILITY | sed -e '/^MARATHON_APP/d' -e 's/MARATHON_//' -e 's/=/ /'| awk '{printf("%s%s ", "--", tolower($1)); for(i=2;i<=NF;i++){printf("%s ", $i)}}'| sed -e 's/ $//'`; do
cmd+=( "$env_op" )
done
# Default zk and master option
@@ -115,8 +116,8 @@ function run_jar {
function logged {
local token="$1[$$]" ; shift
- exec 1> >(exec logger -p user.info -t "$token")
- exec 2> >(exec logger -p user.notice -t "$token")
+ exec 1> >(exec logger -p "${syslog_facility}".info -t "$token")
+ exec 2> >(exec logger -p "${syslog_facility}".notice -t "$token")
"$@"
}
from chaos.
@jimonreal That is a good start, but ideally I could still just log to a flat file and have splunk ingest that.
from chaos.
Related Issues (20)
- the REST api server doesn't response
- 403 On Mesosphere Maven Repo HOT 3
- Realm is not being set when basic authentication is used.
- Invalid basic authentication credentials should not be logged HOT 2
- Secure command line flags should be configurable via environment variables HOT 2
- Listening address for HTTPS cannot be specified
- Document release process
- Provide jetty9 proxy artifact
- Update to Dropwizard Metrics?
- please update the new version of readme
- why the version 0.8.0+ request java 1.8 HOT 1
- hope to support the oauth2
- Get rid of Guice DI
- Extract example into a separate build
- Implement wiring through MacWire and add actor examples.
- Allow --http_credentials_file
- Wiring of metrics rest and http modules through MacWire
- How to register serializer/deserializer to mesosphere.chaos.http.impl.JsonProvider ?
- Please upload to Maven Central HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chaos.