Well, the answer is yes.. to all...
But let's give it a start, the general idea is to use syslog for that.
Syslog is an open thing, so not specific to Cisco. Syslog messages in the Cisco environment can be triggered by a large number of events, not just access
The number of solutions to capture syslog messages are numerous. You can think of screenlogs, databases, Linux/Windows syslog host, Cisco applications like Prime etc etc
So since your question is kind of generic lets use an example.
Very basic:
When you have a switch and put a serial cable into the back you should already see log messages.
You can also store these in a file on the device.
As mentioned syslog messages can also be forwarded to external hosts or applications. This is preferred, as when your device is dead, you also lost your logs, and someone with access to the device can erase their tracks.
You need to read up on syslog in the Cisco environment. Cisco describes all the options in the support documentation per device. These can be found on the Cisco.com site.
Then if you want to take it a step further, there are also access control methodes like TACACS or radius, which control,log and prevent unauthorised access.