It is not possible to log to /var/log/samba/%S.log, in the aim to have a log system based on "service" name. e.g: if I have two shared folders, given share names "mickeymouse" and "donaldduck", I would like to log separately access to both of these shares in separate log files mickeymouse.log and donaldduck.log. Theorically it is possible according to various samba documents such as : "Using Samba", O'reilly, 2nd version of 2003, chapter 12 "Troubleshooting Samba", subchapter "Samba Logs", at url http://us1.samba.org/samba/docs/using_samba/ch12.html See also same book, chapter 6 at http://us1.samba.org/samba/docs/using_samba/ch06.html, subchapter "Logging Configuration Options", table 6.8 stating "log file option...works with ALL variables". Apparently samba does not support %S variable in log file name. FYI %U, %I and %m work normally.
Moreover : whar is created by samba is just a file with the LITERAL name "/var/log/samba/%S.log", ie % has been taken literally by samba and did not lead to var substitution.