mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Logging Errors with 6.20 and 6.21 #165815 01/12/06 12:13 PM
Joined: Jul 2003
Posts: 19
J
Jaillyn Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Jul 2003
Posts: 19
Something changed in mIRC's logging in the last few versions... which isn't acting right at all to me, so I have to revert to an older version.

When you start logging, if you're in a channel like, say, #Help. It'll make a #Help.1.log .. and when you log off, it'll become #Help.log.

If you log on again it'll make #Help.1.log again and then merge it into #Help.log when you log off again.

Well, what if mIRC crashes or your computer crashes? That merging doesn't happen, and something simple turns into a big mess.

I think it was better before when it simply wrote into the logs, because it came to a point that I had up to .8.log or such, and had no idea what went where in my actual log file.. rendering my logging useless.

Re: Logging Errors with 6.20 and 6.21 #165816 01/12/06 01:15 PM
Joined: Dec 2002
Posts: 4,567
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,567
The logging feature in mIRC 6.20 worked in the same way as previous versions, so you must be referring to mIRC 6.21.

In mIRC 6.21 the logging behaviour was changed in order to resolve the corrupt/mixed log file issues that many users reported when using multiple server connections.

mIRC 6.21 resolves this issue by ensuring that log filenames are unique for each status/channel/query/chat window and are only afterwards merged into the main log file.

In previous versions if mIRC or Windows crashed, your whole log could either be lost or corrupted. In the new version, only the non-merged part of your log might be lost or corrupted during a crash. This means that your main log always remains intact and only the most recent log might be lost.

In the event of a crash, you can go to the View Logs dialog in the Tools menu and merge any left-over logs if you wish.

I could make mIRC automatically merge left-over log files in the next version, however if the left-over logs are corrupted that might lead to the same issues as before.

Re: Logging Errors with 6.20 and 6.21 #165817 01/12/06 02:18 PM
Joined: Jul 2003
Posts: 19
J
Jaillyn Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Jul 2003
Posts: 19
Ah, thanks. Would this auto sort by time and such of when the logs began? or would I have to figure that out on my own...

Maybe you could add an option to disable the new logging behavior if someone doesn't have the corrupted issue. smile

Re: Logging Errors with 6.20 and 6.21 #165818 01/12/06 02:51 PM
Joined: Dec 2006
Posts: 4
J
JJS3 Offline
Self-satisified door
Offline
Self-satisified door
J
Joined: Dec 2006
Posts: 4
Is there any feature to move the buffer to the actual log (unless part and rejoin)? It's very annoying as I use to automatically update channel statistics with mircstats which generates the stats from the logfile, which means I have to perform this ritual (part-rejoin) every time I want to update my stats page.

Also.. If there isn't, I would suggest a feature for moving the buffer into the actual log or an option to disable buffering.

Thanks, JJS3.

Re: Logging Errors with 6.20 and 6.21 #165819 01/12/06 04:17 PM
Joined: Oct 2003
Posts: 313
S
Sais Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
I agree that a (say) /flushlogs command might be useful.

In looking for new stuff about logfiles in versions.txt I noticed that there's a 'Merge' option in the logfile dialogue. You could use that.

I had a go at writing a scripted /flushlogs, and now realise how much of a pain it is. My initial attempt had been a simple:

Code:
//var %lfn = $chan(#).logfile | log off | log on -f %lfn


But you end up with logfile names like "#test.network.1.network.1.network.1.log" after a few iterations!

And of course that only works for channels...

Code:
//var %re = $+(/(.*)\.,$network,\.\d+\.log/), %lfn = $+($regsubex($chan(#).logfile,%re,\1),.log) | echo -a %lfn | log off $$chan | log on $chan -f %lfn


is a bit better...


Sais
Re: Logging Errors with 6.20 and 6.21 #165820 01/12/06 10:17 PM
Joined: Aug 2004
Posts: 27
0
0nslaught Offline
Ameglian cow
Offline
Ameglian cow
0
Joined: Aug 2004
Posts: 27
Quote:
Is there any feature to move the buffer to the actual log (unless part and rejoin)? It's very annoying as I use to automatically update channel statistics with mircstats which generates the stats from the logfile, which means I have to perform this ritual (part-rejoin) every time I want to update my stats page.

Also.. If there isn't, I would suggest a feature for moving the buffer into the actual log or an option to disable buffering.

Thanks, JJS3.


This seems to work, but I am not sure of how safe/reliable it is:

Code:
alias flushlog {

  if ($1) {
    var %flush.active = $1
  }
  else {
    var %flush.active = $active
  }

  var %flush.path.1 = $window(%flush.active).logfile
  var %flush.path.target = $gettok($nopath(%flush.path.1), 1, 46)

  var %flush.path.2 = $mklogfn(%flush.path.target)

  var %flush.color = $color(Info Text)

  var %flush.isfile.1 = $isfile(%flush.path.1)
  var %flush.isfile.2 = $isfile(%flush.path.2)

  if ((%flush.isfile.1 == $true) && $&
    (%flush.isfile.2 == $true)) {

    .copy -a $+(", %flush.path.1, ") $&
      $+(", %flush.path.2), ")

    write -c $+(", %flush.path.1, ")

  }

  if ((%flush.isfile.1 == $false) && $&
    (%flush.isfile.2 == $false)) {
    echo %flush.color -ae * /flushlog: file not found
  }
  else {
    echo %flush.color -ae * Flushed log: %flush.active
  }
}


Code:
alias viewlog {

  if ($1) {
    var %view.active = $1
  }

  else {
    var %view.active = $active
  }

  var %view.path.1 = $window(%view.active).logfile
  var %view.path.target = $gettok($nopath(%view.path.1), 1, 46)

  var %view.path.2 = $mklogfn(%view.path.target)

  var %view.isfile.1 = $isfile(%view.path.1)
  var %view.isfile.2 = $isfile(%view.path.2)

  if (%view.isfile.2 != $true) {
    if (%view.isfile.1 == $true) {

      flushlog %view.active

      run $+(", %view.path.1, ")

    }
    else {
      echo $color(Info Text) -ae * /viewlog: file not found
    }
  }
  else {

    flushlog %view.active

    run $+(", %view.path.2, ")

  }
}

Re: Logging Errors with 6.20 and 6.21 #165821 02/12/06 01:53 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
A nice bit of scripting there.
Here's a slightly modified version
Code:
 alias flushlog {
  var %flush.active = $iif($1,$1,$active), %flush.path.1 = $window(%flush.active).logfile, %flush.path.target = $gettok($nopath(%flush.path.1),1,46), %flush.path.2 = $mklogfn(%flush.path.target)
  var %flush.color = $color(Info Text), %flush.isfile.1 = $isfile(%flush.path.1), %flush.isfile.2 = $isfile(%flush.path.2)
  if (%flush.isfile.1 && %flush.isfile.2) {
    .copy -a $qt(%flush.path.1) $qt(%flush.path.2)
    remove $qt(%flush.path.1)
  }
  echo %flush.color -ae * $iif(!%flush.isfile.1 && !%flush.isfile.2,/flushlog: file not found,Flushed log: %flush.active)
}
alias viewlog {
  var %view.active = $iif($1,$1,$active), %view.path.1 = $window(%view.active).logfile, %view.path.target = $gettok($nopath(%view.path.1), 1, 46), %view.path.2 = $mklogfn(%view.path.target)
  var %view.isfile.1 = $isfile(%view.path.1), %view.isfile.2 = $isfile(%view.path.2)
  flushlog %view.active
  $iif(%view.isfile.2,run $qt(%view.path.2),$iif(%view.isfile.1,run $qt(%view.path.1),echo $color(Info Text) -ae * /viewlog: file not found))
}
 

Re: Logging Errors with 6.20 and 6.21 #165822 03/12/06 09:10 PM
Joined: Aug 2004
Posts: 27
0
0nslaught Offline
Ameglian cow
Offline
Ameglian cow
0
Joined: Aug 2004
Posts: 27
I just wanted to post one last update on this topic:

[Changes: The previous /flushlog did not flush the buffer if the main log file hadn't been created yet; it now does. Added an -h switch to hide the results of the /flushlog command.]

Code:
/flushlog [-h] [window]


Code:
/viewlog [window]


Code:
alias flushlog {

  if (-* iswm $1) {
    if (h isin $1) { var %flushlog.hide = $true }
    if ($2 != $null) { var %flush.active = $2 }
    else { var %flush.active = $active }
  }
  else {
    if ($1 != $null) { var %flush.active = $1 }
    else { var %flush.active = $active }
  }

  var %flush.path.1 = $window(%flush.active).logfile
  var %flush.path.target = $gettok($nopath(%flush.path.1), 1, 46)
  var %flush.path.2 = $mklogfn(%flush.path.target)

  var %flush.color = $color(Info Text)

  if ($isfile(%flush.path.1) == $true) {
    .copy -a $qt(%flush.path.1) $qt(%flush.path.2)
    if (!%flushlog.hide) {
      echo %flush.color -atge * Flushed log: %flush.active
    }
    .remove $qt(%flush.path.1)
  }
  else {
    if (!%flushlog.hide) {
      echo %flush.color -atge * /flushlog: file not found
    }
  }
}


Code:
alias viewlog {

  if ($1 != $null) { var %view.active = $1 }
  else { var %view.active = $active }

  var %view.path.1 = $window(%view.active).logfile
  var %view.path.target = $gettok($nopath(%view.path.1), 1, 46)
  var %view.path.2 = $mklogfn(%view.path.target)

  flushlog -h %view.active

  if ($isfile(%view.path.2)) { run $qt(%view.path.2) }
  else { echo $color(Info Text) -agte * /viewlog: file not found }
}

Re: Logging Errors with 6.20 and 6.21 [Re: JJS3] #166082 06/12/06 02:23 AM
Joined: Feb 2006
Posts: 74
G
gbz Offline
Babel fish
Offline
Babel fish
G
Joined: Feb 2006
Posts: 74
Originally Posted By: JJS3
Is there any feature to move the buffer to the actual log (unless part and rejoin)? It's very annoying as I use to automatically update channel statistics with mircstats which generates the stats from the logfile, which means I have to perform this ritual (part-rejoin) every time I want to update my stats page.

Also.. If there isn't, I would suggest a feature for moving the buffer into the actual log or an option to disable buffering.

Thanks, JJS3.


I'm having the same problem with mIRCStats now, so I've decided to go back to 6.20. An option to disable buffering would be very nice indeed.

Re: Logging Errors with 6.20 and 6.21 [Re: gbz] #166085 06/12/06 02:57 AM
Joined: Jul 2003
Posts: 655
Om3n Offline
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
You guys are probably misusing the term buffering, if im not mistaken the buffer settings are how much is kept in memory (and thus availible in sroll backs) for each window. Disabling would mean nothing is availible, no scroll back. (although i guess if all the client is doing is logging then it doesnt really matter in that particular case)


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Re: Logging Errors with 6.20 and 6.21 [Re: Jaillyn] #166100 06/12/06 10:49 AM
Joined: Nov 2003
Posts: 7
P
P4k3 Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
P
Joined: Nov 2003
Posts: 7
Im going crazy about this new "feature"! frown Got an log of a channel that is 95MB large and is +1000days old. And now this I can't get mIRC to write to that file. It writes to #channelname.network.1.log no matter how I try to get it to write to the right one it dosen't! Why mess with a system that works!? frown Revert back to the old system plz! This one really sucks!

Re: Logging Errors with 6.20 and 6.21 [Re: Om3n] #166103 06/12/06 11:06 AM
Joined: Oct 2003
Posts: 313
S
Sais Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
The term 'buffer' simply means a temporary storage place.

The buffer you're talking about is a buffer (in memory) that allows you to get at old information that had been displayed in the window. (And is currently the only use of the term within mIRC)

The buffering here is of the log that will be written to file. The fact that the buffer is a file itself is just an implementation.

Of course, if you were to refer to the buffering of the log file as opposed to the buffering of the window, you'd need two distinct terms to avoid confusion. "Log Buffering" and "Window Buffering" seem perfectly adequate, however laugh


Sais
Re: Logging Errors with 6.20 and 6.21 [Re: Sais] #166150 07/12/06 03:16 AM
Joined: Jul 2003
Posts: 655
Om3n Offline
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
I guess i dont really concider the way logging works with the flat file 'buffering', its not all truely kept in memory surely (that could potentially waste a lot of memory), afaik its actually written to the file, mirc just keeps the file open (and i guess locked) so only mirc can use it. (note that the entire file does not need to be in memory for it to be open)

Anyway, i havn't looked at mircstats for a very long time, but i thought it had the ability to examine dated log files? (as a temporary solution to the problem is appending to a huge existing log file?)

Maybe log file updates could be done on a timely basis (if new data is required to be written) and the files unlocked between updates... this should greately reduce the risk of a crash while a log file is open resulting in corruption. (maybe on top of the timed updates, every xx lines if reached earlier than the next sheduled update)... a command to force the updates would naturally come with this.

Apologies if i am mistaken about how it all works now and in prior versions, logging is of little importance to me so i have never dived too deeply into it.

Last edited by Om3n; 07/12/06 03:18 AM.

"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Re: Logging Errors with 6.20 and 6.21 [Re: P4k3] #166174 07/12/06 12:28 PM
Joined: Dec 2002
Posts: 4,567
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,567
If it worked I wouldn't have changed it :-] see the board for posts regarding multi-server log file corruption issues in previous versions of mIRC and requests by users to fix it.

The current solution is the only method I could think of that would resolve the problem. You can see my post at the top of this thread for an explanation of the method.

If you can think of another method that makes mIRC handle multi-server log files correctly, let me know and I'll see what I can do.

Re: Logging Errors with 6.20 and 6.21 [Re: Khaled] #166182 07/12/06 01:00 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Do we know exactly what was causing it? I'm always on multiple networks/servers and have never had a corrupted log regardless how many times I've crashed mIRC.


Invision Support
#Invision on irc.irchighway.net
Re: Logging Errors with 6.20 and 6.21 [Re: Khaled] #166223 07/12/06 10:41 PM
Joined: Feb 2006
Posts: 74
G
gbz Offline
Babel fish
Offline
Babel fish
G
Joined: Feb 2006
Posts: 74
If log file corruption after crashes only happens when connected to multiple servers... how about keeping log files for multi-server connections seperated by including the $cid in the log's name? Like #chan.network.date.cid.log ...also that way log files would be written without a "buffer" again, fixing the mIRCStats issue. Not sure if this would work as I've never had corrupted logs after a crash (in spite of multi-server connections), but it's an idea.

Re: Logging Errors with 6.20 and 6.21 [Re: gbz] #166236 08/12/06 01:56 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
$cid isn't always the same, though. If you close the connection, open another one, then open the closed one again, it won't have the same $cid, which will probably cause problems.


Invision Support
#Invision on irc.irchighway.net
Re: Logging Errors with 6.20 and 6.21 [Re: Khaled] #166334 09/12/06 05:04 PM
Joined: Nov 2003
Posts: 7
P
P4k3 Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
P
Joined: Nov 2003
Posts: 7
It has been working for +3 years on my logfile, now it dosen't. So I will have to use an old mIRC version from now on?

Re: Logging Errors with 6.20 and 6.21 [Re: Khaled] #166383 10/12/06 03:43 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Perhaps make this an optional setting. If someone is paranoid about corrupting their logs, they can enable the new style logging, and if they want the functionality of old scripts, they can disable the new style, and if they want both.. well they are SOL. :p

-genius_at_work

Re: Logging Errors with 6.20 and 6.21 [Re: P4k3] #166405 10/12/06 10:06 AM
Joined: Dec 2002
Posts: 4,567
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,567
Just to be clear about this: are you saying that mIRC not saving the log at all? If it's not saving the log, then something is wrong.

mIRC will save the log to #channelname.network.N.log and once that window is closed, it will merge that log file into the main log file #channelname.network.log.

If it is merging the log, then it's working correctly.

If it is not merging the log, can you post a step by step method in a clean install of mIRC that reproduces this issue for you?

Page 1 of 2 1 2