setting up logging in executables that link to samba libraries

Steve French smfrench at gmail.com
Fri Jul 25 16:46:23 GMT 2008


That didn't seem to work.  I can get it to work by explicitly setting
the log level and log file though.

      DEBUGLEVEL_CLASS[DBGC_ALL] = 10;
      debug_set_logfile("/var/log/cifs.upcall.log");


On Fri, Jul 25, 2008 at 6:03 AM, Andreas Schneider <anschneider at suse.de> wrote:
> Steve French wrote:
>>
>> Am having trouble setting up the cifs.upcall program to log to samba
>> logs (/usr/local/samba33/var/log.*)
>> Apparently the following is not enough to get debug(0, ... messages to
>> log.
>>
>>     setup_logging(argv[0], false);
>>     load_case_tables();
>>     reopen_logs();
>>
>
>
> Hi Steve,
>
>
> I think you have to do the following:
>
>
> INIT
> -----
>
> /* track talloc null_context memory */
> talloc_enable_null_tracking();
>
> load_case_tables();
> setup_logging(argv[0], false);
>
> /* get_dyn_CONFIGFILE points to the std location. If that fails,
>  * it silently ignores it and use the internal defaults.
>  */
> lp_load(get_dyn_CONFIGFILE(), True, False, False, False);
>
> reopen_logs();
>
> FREE
> -----
>
> gfree_names();
> gfree_loadparm();
> gfree_case_tables();
> gfree_charcnv();
>
> /* release the talloc null_context memory last */
> talloc_disable_null_tracking();
>
> gfree_debugsyms();
>
>
>
>        -- andreas
>



-- 
Thanks,

Steve


More information about the samba-technical mailing list