How can I turn on asterisk's log?

How can I turn on asterisk’s log?
I see trace lines in the code. What can I do to switch them on and get a detailed log file.
Thanks a lot!

See my answer to the MGCP question. Also, you may need to edit logger.conf to ensure that the relevant levels reach a file.