You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

AFP Server logs in Sierra

Hi All..


Im trying to view the Server AFP logs in Sierra with the Console and not having much luck? Now that Apples Server doesn't log afp any more. Does anyone know how to do this?


I can use the command lines below.. but not sure how to export them after a time period.


log stream --info --debug --predicate='process="AppleFileServer"'

or sudo fs_usage AppleFileServer "

I need to look at and store the afp logs for compliancy reasons and am struggling to get this to work, i need to store up to six months worth.


Any help would be great thanks..

Posted on Jun 29, 2017 4:26 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 29, 2017 7:44 AM

Apple seem to think these days that documentation is a dirty word. The only information I can find says a little bit about how to get your program to generate log data using this new log system, and a bit more detail on how to use the log command or Console to view it.


Things like retention period, log rotation, etc. do not seem to be discussed at all.


For your information the log stream command may not be the best choice, this seems to act as the equivalent of the tail command and shows a live 'stream' of the latest log entries. If the specific execution of log stream is stopped then this 'stream' stops. If you run it again it merely picks up and the new time you run it and does not capture or show the gap in between. There are other log commands which supposedly let you view entries for specific time periods.


Linux uses a command called logrotate but Apple do not. There is a similar command in OS X called newsyslog which does a similar thing although I am not sure how much Apple have used this. Apple have a set of scripts in /etc/periodic/ which do logrotation.


With regards to the new log command and its presumed databases I get the impression these are stored in /private/var/db/diagnostics/Persist/ and appear to be rotated based on file size.


I would first use the following command to see if the AppleFileServer process is set to generate logs.


sudo serveradmin settings afp


I would then use the commands like the following to enable logging or the log size


sudo serveradmin settings afp:loggingAttributes:logLogin = yes

sudo serveradmin settings afp:activityLog = yes

sudo serveradmin settings afp:activityLogSize = 1000


Note: Previously the AFP process would use its own AppleFileServiceAccess.log and AppleFileServiceError.log stored in /Library/Logs/AppleFileService/AppleFileServiceAccess.log and /Library/Logs/AppleFileService/AppleFileServiceError.log and rotated by Apple's scripts.

1 reply
Question marked as Top-ranking reply

Jun 29, 2017 7:44 AM in response to rjfrost1973

Apple seem to think these days that documentation is a dirty word. The only information I can find says a little bit about how to get your program to generate log data using this new log system, and a bit more detail on how to use the log command or Console to view it.


Things like retention period, log rotation, etc. do not seem to be discussed at all.


For your information the log stream command may not be the best choice, this seems to act as the equivalent of the tail command and shows a live 'stream' of the latest log entries. If the specific execution of log stream is stopped then this 'stream' stops. If you run it again it merely picks up and the new time you run it and does not capture or show the gap in between. There are other log commands which supposedly let you view entries for specific time periods.


Linux uses a command called logrotate but Apple do not. There is a similar command in OS X called newsyslog which does a similar thing although I am not sure how much Apple have used this. Apple have a set of scripts in /etc/periodic/ which do logrotation.


With regards to the new log command and its presumed databases I get the impression these are stored in /private/var/db/diagnostics/Persist/ and appear to be rotated based on file size.


I would first use the following command to see if the AppleFileServer process is set to generate logs.


sudo serveradmin settings afp


I would then use the commands like the following to enable logging or the log size


sudo serveradmin settings afp:loggingAttributes:logLogin = yes

sudo serveradmin settings afp:activityLog = yes

sudo serveradmin settings afp:activityLogSize = 1000


Note: Previously the AFP process would use its own AppleFileServiceAccess.log and AppleFileServiceError.log stored in /Library/Logs/AppleFileService/AppleFileServiceAccess.log and /Library/Logs/AppleFileService/AppleFileServiceError.log and rotated by Apple's scripts.

AFP Server logs in Sierra

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.