logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Logfile truncation - any way to disable?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Fri Aug 20, 2010 4:23    Post subject: Logfile truncation - any way to disable? Reply with quote

I'm running the current NWNX on my Linux server. It's a pretty simple, basic setup. All I have is nwnx2.so and nwnx_odbc.so in the server directory. It's been a while since I ran the server, so I did have to get everything up to date. Smile

My logs.0 directory ends up with a nwnx2.txt and nwnx_odmbc.txt file, holding the logs for those libraries. All good so far. However, I've discovered that every time I stop and restart the server, the log files get truncated and it starts over again from an empty file. I would prefer it to *not* do that - I've got log rotation scripts in place to handle that (one of them takes care of the main nwserver log, in fact), and I would prefer to rotate my logs via those scripts. Problem is, there's not much to rotate when it keeps getting rewritten from scratch each time I restart the game. Smile

Is there an option I can put in my nwnx2.ini file to tell it to not truncate those log files upon startup?

Also, in the new .ini file which came with the current version, I noticed a section which reads:

[NWNX]
disablenwnxinit=n #Set to "y" to not enforce the NWNX!INIT requirement


Is there any reason why I would want to turn that on? What exactly is the benefit one way or the other?

Thanks in advance!

--Dave
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Fri Aug 20, 2010 12:01    Post subject: Reply with quote

I don't think there's such an option right now, though it would certainly be possible. The canonical way to rotate those logs right now is via the startup script, a la http://www.nwnx.org/phpBB2/viewtopic.php?p=13324#13324. This is probably the safest approach anyway, since it provides some level of certainty that the server isn't accessing those logs when you're rotating them.

NWNX!INIT is a legacy requirement, I believe. Judging by how long non-enforcement has been an option, it's safe to disable (though the only benefit that gets you is the ease of use of not having to call NWNX!INIT before anything else).
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Fri Aug 20, 2010 19:57    Post subject: Reply with quote

Zebranky wrote:
I don't think there's such an option right now, though it would certainly be possible. The canonical way to rotate those logs right now is via the startup script, a la http://www.nwnx.org/phpBB2/viewtopic.php?p=13324#13324. This is probably the safest approach anyway, since it provides some level of certainty that the server isn't accessing those logs when you're rotating them.


That's not an optimal solution for me; the game world I'm running is actively being developed and sometimes the server get restarted more than once per day. I really don't need 4 logs per day in my logs directory. Smile I do a once-per week rotate, and the logrotate program (which is how I do them) has a "copytruncate" option which is used in exactly these kinds of situations, so that the log file itself never goes away and the program using it just keeps on humming along. It's doing this currently for the nwserver application log, and it works flawlessly. The logrotate program also has the nice option of me telling it how many weeks' worth of logs to keep, and it will just automatically delete the oldest ones based on that so that log file doesn't get needlessly cluttered with older information that I don't need.

It's a shame that a "don't truncate log at startup" option doesn't exist.

Quote:

NWNX!INIT is a legacy requirement, I believe. Judging by how long non-enforcement has been an option, it's safe to disable (though the only benefit that gets you is the ease of use of not having to call NWNX!INIT before anything else).


Ok, I'll go ahead and turn that on, then. Thanks!

--Dave
Back to top
View user's profile Send private message
Nabla



Joined: 19 Aug 2010
Posts: 4

PostPosted: Fri Aug 20, 2010 22:23    Post subject: Reply with quote

A easy solution without touching nwnx2 source si to modify the startup script in having a secondary file (named log in my case) that contain the current week log and where nwnxlog is the nwnxlog file.

Code:

cat nwnxlog >>log
Back to top
View user's profile Send private message
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Sat Aug 21, 2010 23:12    Post subject: Reply with quote

Yea, that would work! Sometimes, the simplest solutions are the best; that's what I get for trying to over-think it. Laughing

Thanks!

--Dave
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group