有没有办法将"用户代理" 字符串（浏览器名称）保存到Drupal Log？
when going through the log files it would be really helpful to know if an error was caused by a real user or by a bot.
Is there a way to save the "user agent" string (browser name) to the drupal log?
Using hook_watchdog, you can manipulate all, or some of your log messages. You can find the user agent string in the super-global $_SERVER['HTTP_USER_AGENT']. This way you could for example prepend all "notices" with the user-agent, and all errors with both user-agent and remote IP.
Please note that there's no guarantee on the level of truth of the user-agent as it's really easy to change for a bot creator (and a browser user as well). Thus, depending on the type of bot and whats its owner is trying to do, you might or might not be able to see if it's a bot just using the User-agent.
Typically, when I try to emulate a real average user through a script, I make sure my bot looks like a Firefox user as much as possible but on the other hand, when a crawling bot (such as the Google bots) visits your website, I think it tries to be identied as a Google bot.
Then, depending on what you want to detect, user-agent might or might not be what you should look for.