[unixODBC-support] driver logging

Nick Gorham nick.gorham at easysoft.com
Tue Mar 1 20:20:33 GMT 2005


Eric Sharkey wrote:

>>Well, I tried to replicate what the MS DM does, those two att's control 
>>DM logging. What the driver can do, is to look at the DM variable 
>>ODBCSharedTraceFlag and use that to turn its logging on and off, this 
>>again is the same as under windows AFAIK
>>    
>>
>
>I see.  It would need to check this before every logging attempt,
>I guess.  But there's no way to determine the log file name is there?
>
>The only other way I see to do it would be to read an ini value
>with SQLGetPrivateProfileString to see if the driver should be logging
>and where, but I don't see how to do this without having a DSN,
>which isn't available until SQL(Driver)Connect is called.  Ideally,
>the driver would like to start logging as soon as AllocEnv is called.
>  
>

Well you can get the setting and the file name from the [ODBC] section 
of odbcinst.ini

>Is there any way to read driver specific entries from odbcinst.ini
>from within AllocEnv?  Hmm.  It looks like the PostgreSQL driver has a
>hard coded value of "PostgreSQL" and looks at that section in the
>odbcinst.ini.  Maybe I'll just do that.
>  
>

Yes thats one way

>  
>
>>Yes, but not all platforms have a vsnprintf/vfprintf, thats (if I 
>>remember) why it was done that way.
>>    
>>
>
>Most do.  For those that don't I think it's better to provide an
>implementation rather than not use these functions.  This is what we
>do for our database.
>  
>
Ok, but I have to ask what "problem" this change would fix?

-- 
Nick



More information about the unixODBC-support mailing list