Question for TiddlyServer users

101 views
Skip to first unread message

Arlen Beiler

unread,
Apr 28, 2020, 10:52:24 AM4/28/20
to TiddlyWiki
Good morning everyone, 

As you may have noticed TiddlyServer 2.2 is now in the works, and the main goals are making it simpler and easier to use. So my question is who all uses the "logging" settings to log directly to a file. I'm planning to remove this to keep things simpler. The recommended way to handle long running processes is a process manager. I use PM2 on servers, and on desktop I never log to file, so I'm curious if anyone would really miss this feature if I removed it. 

I'm planning to print error messages to stderr and the startup messages and regular access logs to stdout, instead of writing them to files, so you can use redirection or other Node features to direct those streams to a file. If this is a seriously missed feature I can add a couple ways to do it but it seems like a rather complicated and niche feature, so I doubt anyone uses it. 

Just thought I'd ask
Arlen

Arlen Beiler

unread,
Apr 29, 2020, 10:14:23 AM4/29/20
to TiddlyWiki
Well, it seems like no one really cares what happens to logging. It never was consistent anyway, since the data folder output still went to the console only. I think I'll just say if anyone runs into serious problems here feel free to open an issue on GitHub or email me here. Feel free to post if you didn't notice this thread before this.

Arlen

tony

unread,
Apr 29, 2020, 3:42:46 PM4/29/20
to TiddlyWiki
Thank you Arlen for users consideration and great work :-)

I have no need for logging, currently testing v2.2.0-alpha-3 on a chromebook with crostini

So far so good from the easy npm install based your instructions 

TiddlyServer seems a bit faster than my current simpler set-up from Panos Firbas where the logging is less verbose 

Best,
tony

mauloop

unread,
Apr 29, 2020, 6:04:56 PM4/29/20
to TiddlyWiki
Hi, Arlen.

TiddlyServer is great. I'm still running rel. 2.1.5. I run it with NSSM (https://nssm.cc/), it means as a Windows service on Windows 10.

Here is the batch file (TiddlyServer215.cmd) used by the service to start Tiddlyserver:

@echo off


REM
set TS_PATH=K:\MK\opt64\TiddlyServer-2.0.14
set TS_PATH=C:\Users\boero\MK\opt64\TiddlyServer-2.1.5
REM
set NJS_PATH=K:\MK\opt64\node-v10.15.3
set NJS_PATH=C:\Users\boero\MK\opt64\node-v12.13.0


set PATH=%PATH%;%TS_PATH%;%NJS_PATH%


echo
.
echo
.
echo
================================================================
date
/t
time
/t


cd
%TS_PATH%
node
.exe server.js


@echo on


Here is NSSM config script:

@echo off
set PATH=%PATH%;K:\MK\opt64\nssm-2.24\win64


nssm install
TiddlyServer215 K:\MK\bin\TiddlyServer215.cmd
REM nssm stop
TiddlyServer215


REM
Application tab ===========================================================
nssm
set TiddlyServer215 Application K:\MK\bin\TiddlyServer215.cmd
nssm
set TiddlyServer215 AppDirectory K:\MK\bin\
REM nssm
set TiddlyServer215 AppParameters server


REM
Details tab ===============================================================
nssm
set TiddlyServer215 DisplayName "TiddlyServer 2.1.5"
nssm
set TiddlyServer215 Description "Web server node.js based per istanze TW5 locali (rel. 2.1.5)"
REM nssm
set TiddlyServer215 Start SERVICE_AUTO_START


REM
Log on tab ================================================================
nssm
set TiddlyServer215 ObjectName .\mauloop password
REM nssm
set TiddlyServer215 Type SERVICE_WIN32_OWN_PROCESS


REM
Dependencies ==============================================================
REM nssm
set TiddlyServer215 DependOnService MpsSvc


REM
Process tab ===============================================================
REM nssm
set TiddlyServer215 AppPriority NORMAL_PRIORITY_CLASS
REM nssm
set TiddlyServer215 AppNoConsole 0
REM nssm
set TiddlyServer215 AppAffinity All


REM
Shutdown tab ==============================================================
REM nssm
set TiddlyServer215 AppStopMethodSkip 0
REM nssm
set TiddlyServer215 AppStopMethodConsole 1500
REM nssm
set TiddlyServer215 AppStopMethodWindow 1500
REM nssm
set TiddlyServer215 AppStopMethodThreads 1500


REM
Exit actions tab ==========================================================
REM nssm
set TiddlyServer215 AppThrottle 1500
REM nssm
set TiddlyServer215 AppExit Default Restart
REM nssm
set TiddlyServer215 AppRestartDelay 0


REM I
/O tab ===================================================================
nssm
set TiddlyServer215 AppStdout "K:\MK\log\TiddlyServer\TiddlyServer215.out"
nssm
set TiddlyServer215 AppStderr "K:\MK\log\TiddlyServer\TiddlyServer215.out"


REM
File rotation tab =========================================================
REM nssm
set TiddlyServer215 AppStdoutCreationDisposition 4
REM nssm
set TiddlyServer215 AppStderrCreationDisposition 4
nssm
set TiddlyServer215 AppRotateFiles 1
REM nssm
set TiddlyServer215 AppRotateOnline 0
REM nssm
set TiddlyServer215 AppRotateSeconds 86400
nssm
set TiddlyServer215 AppRotateBytes 10485760


REM
Environment tab ===========================================================
REM nssm
set <servicename> AppEnvironmentExtra JAVA_HOME=C:\java


nssm start
TiddlyServer215
@echo on

 
As you can see NSSM manages redirection of stdout/stderr to a log file as well as log rotation, hence I do not use TiddlyServer built-in logging features.

Regards, )+(

P.S.: I would like to mention @giuse-to work. I've infected him with Tiddlyvirus and he wrote a systemd startup integration for TiddlyServer: https://github.com/giuse-to/tiddlyserver-systemd-startup
Reply all
Reply to author
Forward
0 new messages