Skip to content

Commit 922d732

Browse files
authored
Merge pull request #203 from fieldnine/main
Additional logging configuration for HLTV required configuration
2 parents e9c006f + 452c7ad commit 922d732

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ CS2_LOG="on" ('on'/'off')
117117
CS2_LOG_MONEY=0 (Turns money logging on/off: 0=off, 1=on)
118118
CS2_LOG_DETAIL=0 (Combat damage logging: 0=disabled, 1=enemy, 2=friendly, 3=all)
119119
CS2_LOG_ITEMS=0 (Turns item logging on/off: 0=off, 1=on)
120+
CS2_LOG_FILE=0 (Turns logging into a file on/off: 0=off, 1=on)
121+
CS2_LOG_ECHO=0 (This command sets whether or not all of text that is saved to the log file is also written in the console: 0=off, 1=on)
122+
CS2_DISCONNECT_KILLS=1 (Turning this command on causes players to die in game if they disconnect: 0=off, 1=on)
123+
CS2_LOG_HTTP_URL="<endpoint-url>" (This command is used to set URI of a listener to receive logs via HTTP POST. The URI must be wrapped in double quotes.)
120124
```
121125

122126
### Steam Workshop

sniper/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ ENV CS2_SERVERNAME="cs2 private server" \
8989
SRCDS_TOKEN="" \
9090
CS2_CFG_URL="" \
9191
CS2_LOG="on" \
92+
CS2_LOG_FILE=0 \
93+
CS2_LOG_ECHO=0 \
9294
CS2_LOG_MONEY=0 \
9395
CS2_LOG_DETAIL=0 \
9496
CS2_LOG_ITEMS=0 \
97+
CS2_DISCONNECT_KILLS=0 \
98+
CS2_LOG_HTTP_URL="" \
9599
CS2_ADDITIONAL_ARGS=""
96100

97101
# Set permissions on STEAMAPPDIR

sniper/etc/entry.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ fi
99
## CS2 server debugging
1010
if [[ $DEBUG -eq 2 ]] || [[ $DEBUG -eq 3 ]]; then
1111
CS2_LOG="on"
12+
CS2_LOG_FILE=1
1213
CS2_LOG_MONEY=1
1314
CS2_LOG_DETAIL=3
1415
CS2_LOG_ITEMS=1
@@ -113,11 +114,18 @@ sed -i -e "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" \
113114
-e "s/{{TV_MAXRATE}}/${TV_MAXRATE}/g" \
114115
-e "s/{{TV_DELAY}}/${TV_DELAY}/g" \
115116
-e "s/{{SERVER_LOG}}/${CS2_LOG}/g" \
117+
-e "s/{{SERVER_LOG_FILE}}/${CS2_LOG_FILE}/g" \
118+
-e "s/{{SERVER_LOG_ECHO}}/${CS2_LOG_ECHO}/g" \
116119
-e "s/{{SERVER_LOG_MONEY}}/${CS2_LOG_MONEY}/g" \
117120
-e "s/{{SERVER_LOG_DETAIL}}/${CS2_LOG_DETAIL}/g" \
118121
-e "s/{{SERVER_LOG_ITEMS}}/${CS2_LOG_ITEMS}/g" \
122+
-e "s/{{SERVER_DISCONNECT_KILLS}}/${CS2_DISCONNECT_KILLS}/g" \
119123
"${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
120124

125+
if [[ ! -z $CS2_LOG_HTTP_URL ]]; then
126+
printf 'logaddress_add_http "%s"\n' "${CS2_LOG_HTTP_URL}" >> "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
127+
fi
128+
121129
if [[ ! -z $CS2_BOT_DIFFICULTY ]] ; then
122130
sed -i "s/bot_difficulty.*/bot_difficulty ${CS2_BOT_DIFFICULTY}/" "${STEAMAPPDIR}"/game/csgo/cfg/*
123131
fi

sniper/etc/server.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ tv_transmitall 1 // Transmit all entities (not only
3939
// Logs
4040

4141
log {{SERVER_LOG}} // Turns logging 'on' or 'off', defaults to 'on'
42+
sv_logfile {{SERVER_LOG_FILE}} // Log game events to a log file: 0=off, 1=on
43+
sv_logecho {{SERVER_LOG_ECHO}} // Echo log output to console: 0=off, 1=on
4244
mp_logmoney {{SERVER_LOG_MONEY}} // Turns money logging on/off: 0=off, 1=on
4345
mp_logdetail {{SERVER_LOG_DETAIL}} // Combat damage logging: 0=disabled, 1=enemy, 2=friendly, 3=all
4446
mp_logdetail_items {{SERVER_LOG_ITEMS}} // Turns item logging on/off: 0=off, 1=on
47+
mp_disconnect_kills_players {{SERVER_DISCONNECT_KILLS}} // Kill players on disconnect: 0=off, 1=on

0 commit comments

Comments
 (0)