Skip to content

Commit e456054

Browse files
authored
Merge pull request #89 from joedwards32/logging_configuration_support
Add support for control over logging configuration
2 parents 03454c3 + 93c3674 commit e456054

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ TV_MAXRATE=0 (Max CSTV spectator bandwidth rate allowed, 0 == unl
9999
TV_DELAY=0 (CSTV broadcast delay in seconds)
100100
```
101101

102+
### Logs
103+
104+
```dockerfile
105+
CS2_LOG="on" ('on'/'off')
106+
CS2_LOG_MONEY=0 (Turns money logging on/off: 0=off, 1=on)
107+
CS2_LOG_DETAIL=0 (Combat damage logging: 0=disabled, 1=enemy, 2=friendly, 3=all)
108+
CS2_LOG_ITEMS=0 (Turns item logging on/off: 0=off, 1=on)
109+
```
110+
102111
# Customizing this Container
103112

104113
## Pre and Post Hooks

bullseye/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ ENV CS2_SERVERNAME="cs2 private server" \
6363
TV_DELAY=0 \
6464
SRCDS_TOKEN="" \
6565
CS2_CFG_URL="" \
66+
CS2_LOG="on" \
67+
CS2_LOG_MONEY=0 \
68+
CS2_LOG_DETAIL=0 \
69+
CS2_LOG_ITEMS=0 \
6670
CS2_ADDITIONAL_ARGS=""
6771

6872
# Set permissions on STEAMAPPDIR

bullseye/etc/entry.sh

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ sed -i -e "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" \
4545
-e "s/{{TV_RELAY_PW}}/${TV_RELAY_PW}/g" \
4646
-e "s/{{TV_MAXRATE}}/${TV_MAXRATE}/g" \
4747
-e "s/{{TV_DELAY}}/${TV_DELAY}/g" \
48+
-e "s/{{SERVER_LOG}}/${CS2_LOG}/g" \
49+
-e "s/{{SERVER_LOG_MONEY}}/${CS2_LOG_MONEY}/g" \
50+
-e "s/{{SERVER_LOG_DETAIL}}/${CS2_LOG_DETAIL}/g" \
51+
-e "s/{{SERVER_LOG_ITEMS}}/${CS2_LOG_ITEMS}/g" \
4852
"${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
4953

5054
if [[ ! -z $CS2_BOT_DIFFICULTY ]] ; then

bullseye/etc/server.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ tv_relayvoice 1 // Relay voice data: 0=off, 1=on
3535
tv_timeout 60 // CSTV connection timeout in seconds.
3636
tv_title "{{SERVER_HOSTNAME}} CSTV" // Set title for CSTV spectator UI
3737
tv_transmitall 1 // Transmit all entities (not only director view)
38+
39+
// Logs
40+
41+
log {{SERVER_LOG}} // Turns logging 'on' or 'off', defaults to 'on'
42+
mp_logmoney {{SERVER_LOG_MONEY}} // Turns money logging on/off: 0=off, 1=on
43+
mp_logdetail {{SERVER_LOG_DETAIL}} // Combat damage logging: 0=disabled, 1=enemy, 2=friendly, 3=all
44+
mp_logdetail_items {{SERVER_LOG_ITEMS}} // Turns item logging on/off: 0=off, 1=on

examples/docker-compose.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
- CS2_PW=changeme # (CS2 server password)
1717
- CS2_MAXPLAYERS=10 # (Max players)
1818
- CS2_ADDITIONAL_ARGS # (Optional additional arguments to pass into cs2)
19+
- CS2_CFG_URL # HTTP/HTTPS URL to fetch a Tar Gzip bundle of configuration files/mods
1920
# Game modes
2021
- CS2_GAMEALIAS # (Game type, e.g. casual, competitive, deathmatch. See https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers)
2122
- CS2_GAMETYPE=0 # (Used if CS2_GAMEALIAS not defined. See https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers)
@@ -34,8 +35,13 @@ services:
3435
- TV_RELAY_PW=changeme # CSTV password for relay proxies
3536
- TV_MAXRATE=0 # World snapshots to broadcast per second. Affects camera tickrate.
3637
- TV_DELAY=0 # Max CSTV spectator bandwidth rate allowed, 0 == unlimited
38+
# Logs
39+
- CS2_LOG=on # 'on'/'off'
40+
- CS2_LOG_MONEY=0 # Turns money logging on/off: (0=off, 1=on)
41+
- CS2_LOG_DETAIL=0 # Combat damage logging: (0=disabled, 1=enemy, 2=friendly, 3=all)
42+
- CS2_LOG_ITEMS=0 # Turns item logging on/off: (0=off, 1=on)
3743
volumes:
38-
- cs2:/home/steam/cs2-dedicated/ # (Change /mnt/cs2 according to your volume location)
44+
- cs2:/home/steam/cs2-dedicated/ # Persistent data volume mount point inside container
3945
ports:
4046
- "27015:27015/tcp" # TCP
4147
- "27015:27015/udp" # UDP

0 commit comments

Comments
 (0)