Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiften and glib warnings go straight to terminal which launched the service #321

Open
andrey-utkin opened this issue Dec 31, 2018 · 1 comment

Comments

@andrey-utkin
Copy link
Contributor

Having started a service weeks ago from a tmux shell on my server, now I have that shell's scrollback full of such entries

(process:6411): Json-CRITICAL **: json_node_get_object: assertion 'JSON_NODE_IS_VALID (node)' failed
[warning] Swiften/Component/ComponentSessionStanzaChannel.cpp:50 send: Component: Trying to send a stanza while disconnected.

Setup:
Gentoo Linux, spectrum-2.0.9, swift-4.0.2.
I launch spectrum through OpenRC init script which invokes spectrum2_manager.
Logging configs:

decent /etc/spectrum2 # grep -F -A 5 '[logging]' transports/skype.cfg
[logging]
# log4cxx/log4j logging configuration file in ini format used for main spectrum2 instance.
config = /etc/spectrum2/logging.cfg

# log4cxx/log4j logging configuration file in ini format used for backends.
backend_config = /etc/spectrum2/backend-logging.cfg
decent /etc/spectrum2 # head -n999 logging.cfg backend-logging.cfg
==> logging.cfg <==
log4j.rootLogger=debug, R

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/var/log/spectrum2/${jid}/spectrum2.log

log4j.appender.R.MaxFileSize=10000KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %-5p %c: %m%n

# Disable XML category
log4j.category.Component.XML = OFF

==> backend-logging.cfg <==
log4j.rootLogger=debug, R

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/var/log/spectrum2/${jid}/backends/backend-${id}.log

log4j.appender.R.MaxFileSize=10000KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=${pid}: %d %-5p %c: %m%n
decent /etc/spectrum2 #
@vitalyster
Copy link
Collaborator

Try to call Logging::redirect_stderr(); in backend initialization and let me know if it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants