Answered Does anybody know the answer?

  • Saturday, February 11, 2012 6:59 PM
     
     

    Simple question - if one has a library of SQL/CLR assemblies used all day by production systems, then if we want that code to log to a log file (errors, notable events etc) then

    1. What is the Microsoft recommendation for this?
    2. Can we safely create our own log files in the SQL Server log folder?
    3. Can we assume there will never be a security restriction on creating and writing to files in that folder?
    4. Can we assume that the user-credentials under which SQL/CLR threads execute will always have access to that log folder?

    Thanks

    Cap'n

All Replies

  • Saturday, February 11, 2012 10:42 PM
    Moderator
     
     Answered
    I’m not an official Microsoft source, so I can’t give you the official Microsoft recommendation (nor do I know that one even exists that’s different for SQLCLR than other application/utility routines written in T-SQL), but don’t forget that you also can write to:
    1. Windows Application log
    2. SQL Server log
    3. User-defined trace event (and the equivalent user-defined extended event in SQL Server 2012)
     
    Just a few thoughts beside inventing your own log. I don’t know how much you plan to write to this log and if some sysadmins would consider more than a certain level of logging to 1 or 2 as log pollution.
     
    Cheers,
    Bob