Thread: [ODBC] MyLog and CommLog options

[ODBC] MyLog and CommLog options

From
Daniil Megrabyan
Date:
I extremely need the most verbose log as it possible, I’m trying to enable MyLog and CommLog options in different ways
asa part of Driver description in odbcinst.ini and in the DSN section. No luck.  
I’m under macOS + unixODBC 2.3.4 + psqlodbc 09.05.0400

Current odbc.ini

[ODBC]
Trace = Yes
TraceFile = /usr/local/var/log/odbc/trace.log

[ODBC Drivers]
PostgreSQL = Installed

[PostgreSQL]
Description = PostgreSQL ODBC Driver
Driver = /usr/local/lib/psqlodbcw.so
Setup  = /usr/local/lib/psqlodbcw.so
Protocol = 6.4
FetchBufferSize = 99
ReadOnly = no
Debug = 1
MyLog = /tmp/mylog.log
CommLog = /tmp/commlog.log

What is wrong with my config?

Thanks in advance.

— Daniil A Megrabyan —


Re: [ODBC] MyLog and CommLog options

From
"Inoue, Hiroshi"
Date:
Hi Daniil,

On 2017/02/04 2:15, Daniil Megrabyan wrote:
> I extremely need the most verbose log as it possible, I’m trying to enable MyLog and CommLog options in different
waysas a part of Driver description in odbcinst.ini and in the DSN section. No luck. 
> I’m under macOS + unixODBC 2.3.4 + psqlodbc 09.05.0400
>
> Current odbc.ini

Is it odbc.ini or odbcinst.ini?

> [ODBC]
> Trace = Yes
> TraceFile = /usr/local/var/log/odbc/trace.log
>
> [ODBC Drivers]
> PostgreSQL = Installed
>
> [PostgreSQL]
> Description = PostgreSQL ODBC Driver
> Driver = /usr/local/lib/psqlodbcw.so
> Setup  = /usr/local/lib/psqlodbcw.so
> Protocol = 6.4
> FetchBufferSize = 99
> ReadOnly = no
> Debug = 1
> MyLog = /tmp/mylog.log
> CommLog = /tmp/commlog.log
>
> What is wrong with my config?
>
> Thanks in advance.
>
> — Daniil A Megrabyan —



Re: [ODBC] MyLog and CommLog options

From
Daniil Megrabyan
Date:
> 4 февр. 2017 г., в 4:08, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а):
>
> On 2017/02/04 2:15, Daniil Megrabyan wrote:
>> I extremely need the most verbose log as it possible, I’m trying to enable MyLog and CommLog options in different
waysas a part of Driver description in odbcinst.ini and in the DSN section. No luck. 
>> I’m under macOS + unixODBC 2.3.4 + psqlodbc 09.05.0400
>>
>> Current odbc.ini
>
> Is it odbc.ini or odbcinst.ini?
Sorry, odbcinst.ini of course.

— Daniil A Megrabyan —



Re: [ODBC] MyLog and CommLog options

From
"Inoue, Hiroshi"
Date:
Hi Daniil,

On 2017/02/04 15:38, Daniil Megrabyan wrote:
>> 4 февр. 2017 г., в 4:08, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а):
>>
>> On 2017/02/04 2:15, Daniil Megrabyan wrote:
>>> I extremely need the most verbose log as it possible, I’m trying to enable MyLog and CommLog options in different
waysas a part of Driver description in odbcinst.ini and in the DSN section. No luck. 
>>> I’m under macOS + unixODBC 2.3.4 + psqlodbc 09.05.0400
>>>
>>> Current odbc.ini
>> Is it odbc.ini or odbcinst.ini?
> Sorry, odbcinst.ini of course.

Hmm, odbc.ini exists for datasource description whereas odbcinst.ini
exists for driver description.
How do you call ODBC, via DSN or DSNless?

regards,
Hiroshi Inoue


Re: [ODBC] MyLog and CommLog options

From
Daniil Megrabyan
Date:
> 4 февр. 2017 г., в 10:45, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а):
>
> Hmm, odbc.ini exists for datasource description whereas odbcinst.ini exists for driver description.
> How do you call ODBC, via DSN or DSNless?
I’m trying both. The latest attempt:

miniBagroff:odbc danilabagroff$ cat /usr/local/etc/odbc.ini
[pg_abra1]
Driver = PostgreSQL
Host = localhost
Port = 5432
Protocol = 6.4
FetchBufferSize = 99
Database = abra1
ReadOnly = no
MyLog = /tmp/mylog2.log

miniBagroff:odbc danilabagroff$ cat /usr/local/etc/odbcinst.ini
[ODBC]
Trace = Yes
TraceFile = /usr/local/var/log/odbc/trace.log

[ODBC Drivers]
PostgreSQL = Installed

[PostgreSQL]
Description = PostgreSQL ODBC Driver
Driver = /usr/local/lib/psqlodbcw.so
Setup  = /usr/local/lib/psqlodbcw.so
Protocol = 6.4
FetchBufferSize = 99
ReadOnly = no
MyLog = /tmp/mylog1.log

miniBagroff:odbc danilabagroff$ isql pg_abra1 abra cadabra -v
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> SELECT 1;
+------------+
| ?column?   |
+------------+
| 1          |
+------------+
SQLRowCount returns 1
1 rows fetched
SQL> quit

miniBagroff:odbc danilabagroff$ ls /tmp/mylog*
ls: /tmp/mylog*: No such file or directory


— Daniil A Megrabyan —



Re: [ODBC] MyLog and CommLog options

From
"Inoue, Hiroshi"
Date:

On 2017/02/04 16:51, Daniil Megrabyan wrote:
>> 4 февр. 2017 г., в 10:45, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а):
>>
>> Hmm, odbc.ini exists for datasource description whereas odbcinst.ini exists for driver description.
>> How do you call ODBC, via DSN or DSNless?
> I’m trying both. The latest attempt:
>
> miniBagroff:odbc danilabagroff$ cat /usr/local/etc/odbc.ini
> [pg_abra1]
> Driver = PostgreSQL
> Host = localhost
> Port = 5432
> Protocol = 6.4
> FetchBufferSize = 99
> Database = abra1
> ReadOnly = no
> MyLog = /tmp/mylog2.log

Mylog isn't an option, instead try

Debug = 1

Possibly you will find /tmp/mylog_xxxx.

regards,
Hiroshi Inoue

>
> miniBagroff:odbc danilabagroff$ cat /usr/local/etc/odbcinst.ini
> [ODBC]
> Trace = Yes
> TraceFile = /usr/local/var/log/odbc/trace.log
>
> [ODBC Drivers]
> PostgreSQL = Installed
>
> [PostgreSQL]
> Description = PostgreSQL ODBC Driver
> Driver = /usr/local/lib/psqlodbcw.so
> Setup  = /usr/local/lib/psqlodbcw.so
> Protocol = 6.4
> FetchBufferSize = 99
> ReadOnly = no
> MyLog = /tmp/mylog1.log
>
> miniBagroff:odbc danilabagroff$ isql pg_abra1 abra cadabra -v
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL> SELECT 1;
> +------------+
> | ?column?   |
> +------------+
> | 1          |
> +------------+
> SQLRowCount returns 1
> 1 rows fetched
> SQL> quit
>
> miniBagroff:odbc danilabagroff$ ls /tmp/mylog*
> ls: /tmp/mylog*: No such file or directory
>
>
> — Daniil A Megrabyan —



Re: [ODBC] MyLog and CommLog options

From
Daniil Megrabyan
Date:
> 4 февр. 2017 г., в 11:30, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а):
>
>> miniBagroff:odbc danilabagroff$ cat /usr/local/etc/odbc.ini
>> [pg_abra1]
>> Driver = PostgreSQL
>> Host = localhost
>> Port = 5432
>> Protocol = 6.4
>> FetchBufferSize = 99
>> Database = abra1
>> ReadOnly = no
>> MyLog = /tmp/mylog2.log
>
> Mylog isn't an option, instead try
>
> Debug = 1
>
> Possibly you will find /tmp/mylog_xxxx.
Bingo! It works for tiny example with isql when I put Debug option into odbc.ini(for DSN). Is there is any way to
enablethis option for all driver(in odbcinst.ini) connections? When I’m trying my real life example(with DSNless
connections)the mylog, unfortunately, does not appear. 

Thank you.

— Daniil A Megrabyan —


Re: [ODBC] MyLog and CommLog options

From
"Inoue, Hiroshi"
Date:
Hi Daniil,

On 2017/02/04 17:44, Daniil Megrabyan wrote:
>> 4 февр. 2017 г., в 11:30, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а):
>>
>>> miniBagroff:odbc danilabagroff$ cat /usr/local/etc/odbc.ini
>>> [pg_abra1]
>>> Driver = PostgreSQL
>>> Host = localhost
>>> Port = 5432
>>> Protocol = 6.4
>>> FetchBufferSize = 99
>>> Database = abra1
>>> ReadOnly = no
>>> MyLog = /tmp/mylog2.log
>> Mylog isn't an option, instead try
>>
>> Debug = 1
>>
>> Possibly you will find /tmp/mylog_xxxx.
> Bingo! It works for tiny example with isql when I put Debug option into odbc.ini(for DSN). Is there is any way to
enablethis option for all driver(in odbcinst.ini) connections? When I’m trying my real life example(with DSNless
connections)the mylog, unfortunately, does not appear. 

There's no way to enable this option at once for all driver connections.
The option is for debug and makes rather heavy demands on execution..
For DSNless connections, use connection strings like
Driver=PostgreSQL;server=localhost;.database=abra1;...;Debug=1

regards,
Hiroshi Inoue

> Thank you.
>
> — Daniil A Megrabyan —