Skip to content

Commit 537fcd5

Browse files
authored
misc: add support for sentry logging
1 parent be1da0e commit 537fcd5

File tree

9 files changed

+46
-14
lines changed

9 files changed

+46
-14
lines changed

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ services:
233233
- JVB_BREWERY_MUC
234234
- MAX_BRIDGE_PARTICIPANTS
235235
- OCTO_BRIDGE_SELECTION_STRATEGY
236+
- SENTRY_DSN="${JICOFO_SENTRY_DSN:-0}"
237+
- SENTRY_ENVIRONMENT
238+
- SENTRY_RELEASE
236239
- TZ
237240
- XMPP_DOMAIN
238241
- XMPP_AUTH_DOMAIN
@@ -276,6 +279,9 @@ services:
276279
- JVB_OCTO_PUBLIC_ADDRESS
277280
- JVB_OCTO_BIND_PORT
278281
- JVB_OCTO_REGION
282+
- SENTRY_DSN="${JVB_SENTRY_DSN:-0}"
283+
- SENTRY_ENVIRONMENT
284+
- SENTRY_RELEASE
279285
- TZ
280286
depends_on:
281287
- prosody

env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,16 @@ RESTART_POLICY=unless-stopped
390390

391391
# Authenticate using external service or just focus external auth window if there is one already.
392392
# TOKEN_AUTH_URL=https://auth.meet.example.com/{room}
393+
394+
# Sentry Error Tracking
395+
# Sentry Data Source Name (Endpoint for Sentry project)
396+
# Example: https://public:private@host:port/1
397+
#JVB_SENTRY_DSN=
398+
#JICOFO_SENTRY_DSN=
399+
#JIGASI_SENTRY_DSN=
400+
401+
# Optional environment info to filter events
402+
#SENTRY_ENVIRONMENT=production
403+
404+
# Optional release info to filter events
405+
#SENTRY_RELEASE=1.0.0

jicofo/rootfs/defaults/logging.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
{{ if .Env.SENTRY_DSN | default "0" | toBool }}
2+
handlers=java.util.logging.ConsoleHandler,io.sentry.jul.SentryHandler
3+
{{ else }}
14
handlers= java.util.logging.ConsoleHandler
5+
{{ end }}
26

37
java.util.logging.ConsoleHandler.level = ALL
48
java.util.logging.ConsoleHandler.formatter = net.java.sip.communicator.util.ScLogFormatter
@@ -10,6 +14,7 @@ net.sf.level=SEVERE
1014
net.java.sip.communicator.plugin.reconnectplugin.level=FINE
1115
org.ice4j.level=SEVERE
1216
org.jitsi.impl.neomedia.level=SEVERE
17+
io.sentry.jul.SentryHandler.level=WARNING
1318

1419
# Do not worry about missing strings
1520
net.java.sip.communicator.service.resources.AbstractResourcesService.level=SEVERE
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/with-contenv bash
22

3+
export SENTRY_RELEASE="${SENTRY_RELEASE:-$(apt-cache policy jicofo | sed -n '/Installed/p' | sed -e 's/[^:]*: //')}"
4+
35
if [[ -z $JICOFO_AUTH_PASSWORD ]]; then
46
echo 'FATAL ERROR: Jicofo auth password must be set'
57
exit 1
@@ -11,10 +13,7 @@ if [[ "$JICOFO_AUTH_PASSWORD" == "$OLD_JICOFO_AUTH_PASSWORD" ]]; then
1113
exit 1
1214
fi
1315

16+
tpl /defaults/logging.properties > /config/logging.properties
1417
tpl /defaults/jicofo.conf > /config/jicofo.conf
1518

16-
if [[ ! -f /config/logging.properties ]]; then
17-
cp /defaults/logging.properties /config
18-
fi
19-
2019
chown -R jicofo:jitsi /config

jigasi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ services:
4343
- GC_CLIENT_EMAIL
4444
- GC_CLIENT_ID
4545
- GC_CLIENT_CERT_URL
46+
- SENTRY_DSN="${JIGASI_SENTRY_DSN:-0}"
47+
- SENTRY_ENVIRONMENT
48+
- SENTRY_RELEASE
4649
- TZ
4750
depends_on:
4851
- prosody

jigasi/rootfs/defaults/logging.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
{{ if .Env.SENTRY_DSN }}
2+
handlers=java.util.logging.ConsoleHandler,io.sentry.jul.SentryHandler
3+
{{ else }}
14
handlers= java.util.logging.ConsoleHandler
5+
{{ end }}
26

37
java.util.logging.ConsoleHandler.level = ALL
48
java.util.logging.ConsoleHandler.formatter = net.java.sip.communicator.util.ScLogFormatter
@@ -10,6 +14,7 @@ net.sf.level=SEVERE
1014
net.java.sip.communicator.plugin.reconnectplugin.level=FINE
1115
org.ice4j.level=SEVERE
1216
org.jitsi.impl.neomedia.level=SEVERE
17+
io.sentry.jul.SentryHandler.level=WARNING
1318

1419
# Do not worry about missing strings
1520
net.java.sip.communicator.service.resources.AbstractResourcesService.level=SEVERE

jigasi/rootfs/etc/cont-init.d/10-config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/with-contenv bash
22

3+
export SENTRY_RELEASE="${SENTRY_RELEASE:-$(apt-cache policy jigasi | sed -n '/Installed/p' | sed -e 's/[^:]*: //')}"
4+
35
if [[ -z $JIGASI_XMPP_PASSWORD ]]; then
46
echo 'FATAL ERROR: Jigasi auth password must be set'
57
exit 1
@@ -11,15 +13,13 @@ if [[ "$JIGASI_XMPP_PASSWORD" == "$OLD_JIGASI_XMPP_PASSWORD" ]]; then
1113
exit 1
1214
fi
1315

16+
tpl /defaults/logging.properties > /config/logging.properties
1417
tpl /defaults/sip-communicator.properties > /config/sip-communicator.properties
18+
1519
if [[ -f /config/custom-sip-communicator.properties ]]; then
1620
cat /config/custom-sip-communicator.properties >> /config/sip-communicator.properties
1721
fi
1822

19-
if [[ ! -f /config/logging.properties ]]; then
20-
cp /defaults/logging.properties /config
21-
fi
22-
2323
mkdir -pm777 /tmp/transcripts
2424
chown jigasi:jitsi /tmp/transcripts
2525

jvb/rootfs/defaults/logging.properties

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
{{ if .Env.SENTRY_DSN | default "0" | toBool }}
2+
handlers=java.util.logging.ConsoleHandler,io.sentry.jul.SentryHandler
3+
{{ else }}
14
handlers= java.util.logging.ConsoleHandler
5+
{{ end }}
26

37
java.util.logging.ConsoleHandler.level = ALL
48
java.util.logging.ConsoleHandler.formatter = net.java.sip.communicator.util.ScLogFormatter
59

610
net.java.sip.communicator.util.ScLogFormatter.programname=JVB
711

812
.level=INFO
9-
1013
org.jitsi.videobridge.xmpp.ComponentImpl.level=FINE
14+
io.sentry.jul.SentryHandler.level=WARNING
1115

1216
# All of the INFO level logs from MediaStreamImpl are unnecessary in the context of jitsi-videobridge.
1317
org.jitsi.impl.neomedia.MediaStreamImpl.level=WARNING
14-

jvb/rootfs/etc/cont-init.d/10-config

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/with-contenv bash
22

33
export LOCAL_ADDRESS=$(ip addr show dev "$(ip route|awk '/^default/ { print $5 }')" | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
4+
export SENTRY_RELEASE="${SENTRY_RELEASE:-$(apt-cache policy jitsi-videobridge2 | sed -n '/Installed/p' | sed -e 's/[^:]*: //')}"
45

56
if [[ -z $JVB_AUTH_PASSWORD ]]; then
67
echo 'FATAL ERROR: JVB auth password must be set'
@@ -18,10 +19,7 @@ if [[ -f /config/custom-sip-communicator.properties ]]; then
1819
cat /config/custom-sip-communicator.properties >> /config/sip-communicator.properties
1920
fi
2021

22+
tpl /defaults/logging.properties > /config/logging.properties
2123
tpl /defaults/jvb.conf > /config/jvb.conf
2224

23-
if [[ ! -f /config/logging.properties ]]; then
24-
cp /defaults/logging.properties /config
25-
fi
26-
2725
chown -R jvb:jitsi /config

0 commit comments

Comments
 (0)