Facebook's built-in chat service is convenient, but where it lacks when compared to software-based chat tools is in letting users log past conversations. Facebook intentionally does not save full conversations, however it does keep a few lines from the last time you chatted with someone so you can pick up where you left off.
If you're looking for more though, there's a new Firefox add-on called Facebook Chat History Manager that saves all of your conversations locally. As long as you're using the browser with it installed, it saves everything and puts it into a log that can be filtered by friend or date. There is, however, no search function, so if you're looking for a specific word or phrase from a past chat, you'll have to view all your chats on one page, then use Firefox's built-in search tool. Hopefully a later version will add a way to search from the local index.
Since the extension saves all of your chats locally, you're totally hosed if your computer gets lost, stolen, or suffers failed hard drive. On the flip side of that, the chat log viewer is password protected, so there are no worries of someone else gaining access to your entire chat history.
If you're a heavy Facebook chat user who does not access the service through a software chat client, this extension is one of the easiest ways to log your chats, and definitely worth the download.