RE: Logging problem with --log, my.cnf etc.

2002-02-21 Thread Luc Foisy

Does mysql have permission to write to that location?

-Original Message-
From: alastair [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 10:33 AM
To: [EMAIL PROTECTED]
Subject: Logging problem with --log, my.cnf etc.


Hello,

I am using MySQL 3.23.36 on Linux. This is a small gripe about a product
I am otherwise very happy with. I hope I have not missed the obvious or
been stupid some other way.

The problem - I want to log somewhere other than $DATADIR. Things are
set up like ;

| log | ON
| log_update  | OFF
| log_bin | OFF
| log_slave_updates   | OFF


I would have liked to use the my.cnf file to achieve this but it doesn't
appear to work i.e. a line like (in the [mysqld] section) ;

log=/var/log/mysql.log

has no effect. Looking at 'mysqld --help' output would show this is set
i.e.

logfile: /var/log/mysql.log

but this file is not created. In fact, logging appears to stop.

So, I thought I would try adding the argument to my mysql init script -
args that are passed to 'safe_mysqld' i.e.

In /etc/init.d/mysql I added ;

--log=/var/log/mysql.log

to the command line for 'safe_mysqld'.

But this too had no effect - no log file created, no logging.

So ... I decided to look at 'safe_mysqld'. This is a much more complex
program but, seemed to me, to be potentially ignoring a '--log' line
i.e.

In the 'case' statement near the top ;

for arg do
  case $arg in
  # these get passed explicitly to mysqld
   --basedir=*) MY_BASEDIR_VERSION=`echo $arg | sed -e s;--basedir=;;`
;;
   --datadir=*) DATADIR=`echo $arg | sed -e s;--datadir=;;` ;;
   --pid-file=*) pid_file=`echo $arg | sed -e s;--pid-file=;;` ;;
   ...

There is no catch for '--log', and I assume the catchall default ;

  *)
   if test -n $pick_args
   ...

misses it as well (or it's ignored later ...).


So ... I (probably badly) hacked this script a bit and now I have
logging to /var/log/mysql.log.


I was looking in some 'changelogs' and found no mention of problems. I
also searched the list archives and found one other person with a
similar problem which was never resolved ;

http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:msp:24135:lkonncgmkabnpiggbdio

So, would someone take a look at this and see if they can figure out
where the problem lies? I admit it might be me.

Cheers,



-- 
Alastair   |   |
[EMAIL PROTECTED]|   |
http://www.nucoda.com  |   |


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Logging problem with --log, my.cnf etc.

2002-02-21 Thread alastair

On Thu, Feb 21, 2002 at 01:02:02PM -0500, Luc Foisy wrote:
 Does mysql have permission to write to that location?

Yes. I'm starting and stopping MySQL using an init script a la Redhat.
This calls 'safe_mysqld' with some args (e.g. --user,--pid-file etc.) -
all started as user root as usual.

The problem is that I could not see the '--log' file getting recognised
or used in safe_mysqld. As I said, I would much rather be using
/etc/my.cnf with the log= syntax.

What I did in 'safe_mysqld' was ;

1) Add 

--log=/var/log/mysql.log 

to the call to safe_mysqld in my mysql init script

2) Add 

--log=*)log=`echo $arg | sed -e s;--log=;;` ;;

to the 'case' statement at the top.

3) After the USER_OPTION= block further down I added ;

LOG_OPTION=--log=$log
touch $log; chown $user $log

4) Added $LOG_OPTION to the actual call to $MYSQLD (x2) near the bottom.



This is a production machine I am playing with here at work so I am
limited in what I can screw around with. I need to re-test this stuff at
home again.

But - has anyone managed to change MySQL's log file using my.cnf and the
log= syntax?

Cheers,


-- 
Alastair   |   |
[EMAIL PROTECTED]|   |
http://www.nucoda.com  |   |


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Logging problem with --log, my.cnf etc.

2002-02-21 Thread alastair

On Thu, Feb 21, 2002 at 01:47:50PM -0500, Luc Foisy wrote:
 
 maybe the variable you are using is not right
 
 my 'show variables' indicates log with a value of OFF
 | log | OFF 
 
 yet mysql still generates its standard error file

Hi Luc,

Thanks for the reply (but please just reply to the list and not a CC -
I've subscribed).

I want 'LOG' to be 'ON' so I can log updates,selects etc. i.e. standard
logging (-l,--log,--log=file). The stderr log (err_log) is of no
relevance to me for this.

Cheers,


-- 
Alastair   |   |
[EMAIL PROTECTED]|   |
http://www.nucoda.com  |   |


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php