Do you think you'll want to join log data with other data in the database? If so, the overhead of a db insert is likely justified so existing relationships can be easily leveraged.
Would logging the data in the database allow you to reduce the amount of data you're logging greatly (due to existing relationships in the db)? For example, a log in the database of user activity could simply be a table containing a userid, activityid, and a timestamp. A log file this lean in a file wouldn't be human readable. Depending on your needs, you'd need to capture at least some of the user's data in the log file to assure it can be useful and human readable on its own.
Any chance you'll want to leverage this log data in the front end or via an admin tool down the road? If so, DB write is likely preferable.