You're partially right in that Syslog and SNMP Traping do serve similar functions, however there are some fundamental differences. (Based on your commands/tags on the quesiton, I assume you're asking specifically about their function on a Cisco Router/Switch.)
SNMP serves three main functions as you mentioned:
- Gathering of information with
- Changing configuration on a devices via
- Alerting via SNMP Traps, which will give you similar information to your Syslog events.
Syslog is only capable of the third option, sending information from the device to a server.
The primary differences between Syslog and SNMP are:
- Syslog will only send messages based on your current logging level and debugs in a Cisco device. SNMP Traps can be configured independently of your current logging level.
Syslog is insecure, the messages are in plain text. EDIT: Per @ytti in the comments below, there is an encrypted transport option for Syslog on IOS devices. See this Cisco document on Reliable Transport of Syslog for more information on BEEP transport with TLS encryption. With that said, I would still recommend looking at SNMP v3, as it has built in encryption and authentication for the handling of it's transactions without needing to change the transport protocol/configuration.
For the most part, which logging method you should use really depends on your environment.
I've worked in shops that only used SNMP Traps, shops that only used Syslog events, and shops that used both (sent to two different servers under the control of two different departments).
It will depend greatly on the NMS/Syslog server you are using to gather this information, and what you wish to monitor in each Cisco device.
For more information on SNMP Traps in Cisco IOS devices, see this Cisco Tech Note.
For more information on Syslog in Cisco devices (including PIX/ASA), see this Cisco Press Article.
For more information on Logging in general on Cisco IOS devices see this Cisco Support Forum Doc on logging on IOS devices.