Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Login/out logs?

Login/out logs?
Thread Tools
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Aug 23, 2003, 01:14 PM
 
Where is a log of login/outs kept? I've tried nearly all the log files I can find and nothing has it. I'm trying to report the login/outs and times for a lab of computers to one central server. Any recommendations for that would be welcome too. Thanks.
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Aug 23, 2003, 02:38 PM
 
I don't think there is a log of GUI logins.

You could pretty easily add one though.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Aug 23, 2003, 03:47 PM
 
Originally posted by Arkham_c:
You could pretty easily add one though.
care to share?
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Aug 23, 2003, 09:02 PM
 
Originally posted by philzilla:
care to share?
The login is easy. Add a login item to /Library/Preferences/loginwindow.plist that logs the login of a user.

The logout could be handled by the same app, when it is asked to quit.

I could whip up a Realbasic app to do that in about 2 minutes.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Aug 23, 2003, 09:25 PM
 
Fire up terminal.

Run last

Be happy.

- proton
     
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status: Offline
Reply With Quote
Aug 24, 2003, 12:15 AM
 
To isolate GUI logins within the last month:
last | grep console
(Previous month's logs are gzipped in /var/log when the monthly script runs).

Or, as Arkham_c suggested, you can add a loginhook to log the user logins. In fact, that is the very example Mike Bombich uses with his LoginWindow Manager application:
http://www.bombich.com/software/lwm.html
     
Thinine  (op)
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Aug 24, 2003, 11:04 PM
 
Where does last get it's information? I'm more interested in remotely reporting logins than anything. I know that I could run a logout script to report it, but I'd rather have something automated, like syslogd can do. I'd also like to report certain system events, like sudo attempts.
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Aug 25, 2003, 08:49 AM
 
Originally posted by Thinine:
Where does last get it's information? I'm more interested in remotely reporting logins than anything. I know that I could run a logout script to report it, but I'd rather have something automated, like syslogd can do. I'd also like to report certain system events, like sudo attempts.
last uses /var/log/wtmp

I didn't realize that it would log the GUI logins, but that could suit your needs.

Just know that the wtmp file is not a regular text file. The entries are encoded as fixed-size byte entries, so some translation would be required if you choose not to use "last" (which does this for you).
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:24 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2