Skip to content

Commit 20345eb

Browse files
update log config
1 parent 9ee28a0 commit 20345eb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test_code/python_scripts/fabfile.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from fabric import task
1414

1515
import logging
16+
import sys
1617

1718

1819
def getObserveConfig(config, environment):
@@ -43,7 +44,12 @@ def getCurlCommand(options):
4344
if "FLAGS" in options:
4445
FLAGS.update(options["FLAGS"])
4546

46-
return f'curl "https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/{options["BRANCH"]}/observe_configure_script.sh" | bash -s -- --customer_id {YOUR_CUSTOMERID} --ingest_token {YOUR_DATA_STREAM_TOKEN} --observe_host_name https://{YOUR_CUSTOMERID}.collect.{DOMAIN}.com/ --config_files_clean {FLAGS["config_files_clean"]} --ec2metadata {FLAGS["ec2metadata"]} --datacenter {FLAGS["datacenter"]} --appgroup {FLAGS["appgroup"]} '
47+
logging.info(
48+
"curl command = %s",
49+
f'curl "https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/{options["BRANCH"]}/observe_configure_script.sh" | bash -s -- --customer_id {YOUR_CUSTOMERID} --ingest_token ****** --observe_host_name https://{YOUR_CUSTOMERID}.collect.{DOMAIN}.com/ --config_files_clean {FLAGS["config_files_clean"]} --ec2metadata {FLAGS["ec2metadata"]} --datacenter {FLAGS["datacenter"]} --appgroup {FLAGS["appgroup"]}',
50+
)
51+
52+
return f'curl "https://raw.githubusercontent.com/observeinc/linux-host-configuration-scripts/{options["BRANCH"]}/observe_configure_script.sh" | bash -s -- --customer_id {YOUR_CUSTOMERID} --ingest_token {YOUR_DATA_STREAM_TOKEN} --observe_host_name https://{YOUR_CUSTOMERID}.collect.{DOMAIN}.com/ --config_files_clean {FLAGS["config_files_clean"]} --ec2metadata {FLAGS["ec2metadata"]} --datacenter {FLAGS["datacenter"]} --appgroup {FLAGS["appgroup"]}'
4753

4854

4955
# your "parallelness"
@@ -128,9 +134,10 @@ def test(
128134
log_path = log_file_name(log_path_pattern)
129135

130136
logging.basicConfig(
131-
filename=log_path,
137+
# filename=log_path,
132138
encoding="utf-8",
133139
level=log_levels[log_level],
140+
handlers=[logging.FileHandler(log_path), logging.StreamHandler(sys.stdout)],
134141
)
135142

136143
logging.info(seperator)

0 commit comments

Comments
 (0)