Problem with the logfile when running as a service

Think you've found a bug? Post a description here.

Moderator: Serin

Post Reply
GerardFolkerts
Posts: 2
Joined: Wed Dec 27, 2006 5:12 am

Problem with the logfile when running as a service

Post by GerardFolkerts » Wed Dec 27, 2006 5:27 am

I've installed the 2.4 version and noticed that the logfile is not generated when cerberus is running.

I've checked the existance of the logfile format file and it's there (in the same directory as the executable, and it's original). The Log directory is there as well.

Could somebody help me?

Regards,

Gerard

mdj
Moderator
Posts: 656
Joined: Mon Aug 18, 2003 4:00 am
Location: Denmark
Contact:

Post by mdj » Wed Dec 27, 2006 3:47 pm

Are any logging options enabled? (Server Manager / Logging)
Does the Cerberus user have the necessary rights to write to the directory?
Morten Due Jørgensen
http://www.mdjnet.dk

GerardFolkerts
Posts: 2
Joined: Wed Dec 27, 2006 5:12 am

Post by GerardFolkerts » Thu Dec 28, 2006 2:51 am

I've checked the server (2k3). Cerberus is running as a service with the local system account. The system account has full control on the log file directory. The stats.dat file is updated so that should confirm write rights in the directory.

Logging options turned on are Log messages to screen, Log Commands and Log Error Messages.

In the previous version the logging was working fine. I have changed nothing to the directory structure when upgrading to version 2.4 (actually the verison shows as 2.4.0.4).

So this keeps me complete puzzled....

Ronaldone
Posts: 2
Joined: Fri Jan 05, 2007 11:27 am
Location: Wien

Post by Ronaldone » Fri Jan 05, 2007 11:31 am

GerardFolkerts wrote:Cerberus is running as a service with the local system account. The system account has full control on the log file directory. The stats.dat file is updated so that should confirm write rights in the directory.
Logging options turned on are Log messages to screen, Log Commands and Log Error Messages.
I have the same situation, no logfile is being created.

-Ronald

User avatar
Serin
Site Administrator
Posts: 1785
Joined: Sat Jan 01, 2005 6:57 pm
Location: United States
Contact:

Post by Serin » Fri Jan 12, 2007 8:44 pm

Hello,

Can you post the contents of the log4j.xml file located in the Cerberus FTP Server root install directory?

Thanks,

mdj
Moderator
Posts: 656
Joined: Mon Aug 18, 2003 4:00 am
Location: Denmark
Contact:

Post by mdj » Sat Jan 13, 2007 4:23 am

Mine is shown below (I haven't had logging since october).

Code: Select all


<?xml version="1.0" encoding="UTF-8" ?>

<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="false">



<appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
<param name="activeFileName" value="log/server.log"/>
<param name="fileNamePattern" value="log/server.%i.log"/>
</rollingPolicy>
<triggeringPolicy class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
<param name="maxFileSize" value="10000KB"/>
</triggeringPolicy>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}]:%7.7p [%6.6x] - %m%n"/>
</layout>
</appender>


<root>
<level value ="INFO" class="org.apache.log4j.xml.XLevel"/>
<appender-ref ref="FILE"/>
</root>
</log4j:configuration>
Morten Due Jørgensen
http://www.mdjnet.dk

Ronaldone
Posts: 2
Joined: Fri Jan 05, 2007 11:27 am
Location: Wien

Post by Ronaldone » Sat Jan 13, 2007 11:56 am

Seems to be the same here:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?> 
- <log4j:configuration xmlns:log4j="http://logging.apache.org/" debug="false">
- <appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
- <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
<param name="activeFileName" value="log/server.log" />
<param name="fileNamePattern" value="log/server.%i.log" />
</rollingPolicy>
- <triggeringPolicy class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
<param name="maxFileSize" value="10000KB" />
</triggeringPolicy>
- <layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}]:%7.7p [%6.6x] - %m%n" />
</layout>
</appender>
- <root>
<level value="INFO" class="org.apache.log4j.xml.XLevel" />
<appender-ref ref="FILE" />
</root>
</log4j:configuration>
Could this be related to regionale (in my case German) settings?
-Ronald

mdj
Moderator
Posts: 656
Joined: Mon Aug 18, 2003 4:00 am
Location: Denmark
Contact:

Post by mdj » Sun Jan 14, 2007 11:52 am

I don't think so, I am running pure english, both OS and Cerberus, and I still have the problem.
Morten Due Jørgensen
http://www.mdjnet.dk

User avatar
Serin
Site Administrator
Posts: 1785
Joined: Sat Jan 01, 2005 6:57 pm
Location: United States
Contact:

Post by Serin » Mon Jan 15, 2007 12:15 pm

Hey guys, I am currently working to reproduce the issue. It's a little strange because the log file just seemed to randomly stop working for you guys. I recently transitioned from the log file I originally implemented for Cerberus to the C++ version of log4j (an excellent logging package for java). Apparently, I still have a few bugs or settings to work out.

I'll try to have something soon. Try deleting the old log files and seeing if the log is recreated when you restart Cerberus.

mdj
Moderator
Posts: 656
Joined: Mon Aug 18, 2003 4:00 am
Location: Denmark
Contact:

Post by mdj » Tue Jan 16, 2007 1:54 am

Nope, nothing. I just removed the old server.1.log - no problems there, Cerberus had no open handles to that file - and then I restarted the Cerberus service and logged in to provoke some loggings, but nothing was logged to file. I can send you my entire directory containing Cerberus plus registry settings, if you need it.
Morten Due Jørgensen
http://www.mdjnet.dk

dyimez
Posts: 1
Joined: Wed Jan 31, 2007 1:12 am

Post by dyimez » Thu Feb 01, 2007 12:51 am

I have the same problem with log file not created whenever the cerberus v2.4 is running in services mode. Is there a fix available for this bug?

User avatar
Serin
Site Administrator
Posts: 1785
Joined: Sat Jan 01, 2005 6:57 pm
Location: United States
Contact:

Post by Serin » Wed Feb 21, 2007 1:58 am

I believe I've discovered the reason for the problem and a temporary quick fix.

The path to the log file is listed in the log4j.xml file as relative to the root directory Cerberus FTP Server is installed in. When Cerberus FTP Server is started normally from the Start menu, the working directory is the same directory as the executable. When started as a service, the working directory is different. The quick fix is to change the relative path to the log files in the log4j.xml file to absolute paths. The log4j.xml file is located in the root of the directory Cerberus FTP Server is installed to (normally, "c:\Program Files\Cerberus").

The following change needs to be made:

Code: Select all


<appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
<param name="activeFileName" value="log/server.log"/>
<param name="fileNamePattern" value="log/server.%i.log"/>
</rollingPolicy>
<triggeringPolicy class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
<param name="maxFileSize" value="10000KB"/>
</triggeringPolicy>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{yyyy-MM-dd HH:mm:ss}]:%7.7p [%6.6x] - %m%n"/>
</layout>
</appender>

The lines "<param name="activeFileName" value="log/server.log"/>"

and

"<param name="fileNamePattern" value="log/server.%i.log"/>"


Need to be changed to:

"<param name="activeFileName" value="c:/Program Files/Cerberus/log/server.log"/>"

and

"<param name="fileNamePattern" value="c:/Program Files/Cerberus/log/server.%i.log"/>"

mdj
Moderator
Posts: 656
Joined: Mon Aug 18, 2003 4:00 am
Location: Denmark
Contact:

Post by mdj » Wed Feb 21, 2007 4:26 am

- or you can simply create the directory that it is looking for. It appears the working directory of a service is "C:\Windows\System32", and if you in this directory create a "log" directory (and restart the Cerberus service), the logs will go there. It is a bit messy to have log files there, but temporarily, while waiting for the *real* fix, it is acceptable.
Morten Due Jørgensen
http://www.mdjnet.dk

Post Reply