Specifying a Web Server Log File Mask

A log file mask is a property that specifies what Web server log file names will be as they are rotated over time, or based on file size. For example, a daily Internet Information Services (IIS) log file rotation is specified as exyymmdd.log: the log file name will have a prefix of "ex", a two-digit year, a two-digit month, and a two-digit day. You set the log file mask when you configure a Web server using Commerce Server Manager.

User should append an extension to the end of their file mask, for example, add ".log" at the end of a mask for most cases.

Rules for log file masks

  • Fixed strings can be appended any where in the log file mask.

  • Log file masks support directory-level masking.

  • Do not use the following characters in the log file mask: : | * ? < > / "

  • Log file rotation can be specified in the mask. The following table lists log file mask values that specify rotation.

    Log file mask Description Example
    0 Extended file names  
    1 IIS daily rotation ex$y$m$d.log
    2 IIS weekly rotation ex$y$m$w.log
    3 IIS monthly rotation ex$y$m.log
    4 IIS hourly rotation ex$y$m$d$h.log

    The following table lists the characters to use when you specify the log file mask.

    Character Description
    $M Full month name (Only English names are supported)
    $m Month 01-12
    $d Day of the month 01-31
    $h hour 00-23
    $y 2-digit year 00-99
    $Y 4-digit year
    $w Week of the month 01-05
    $n For sequential numbering to support IIS extended log file names (only single digit numbers).
    $N Same as $n but for all numbers with one or more digits.

    This should be the last mask before the file extension.

    Strings not starting with numerals can proceed $N.

Sample Log File Masks

Sample 1

If you rename the IIS W3C extended log files so that the server names are prefixed to the log file name, the log file names might look like the following for daily rotation:

Server1_ex010810.log

Server1_ex010811.log

To retrieve these log files for import, type Server1_ex$y$m$d.log in the Log file mask box.

Sample 2

If you select the "Unlimited file size" or "when file size reaches certain size" option in IIS logging properties, then the file names will be in the format extend#.log, that is, extend1.log, extend2.log, and so on.

To retrieve these log files for log import, type extend$n.log in the Log file mask box.

Sample 3

The Log file mask box can also include a directory. To pick up log files from the folder e:\logs\server1\extend1.log, for example, you can specify one of the following in the Log file mask box:

  • If the Log path is e:\logs\server1\, type extend$n.log in the Log file mask box.
  • If the Log path is e:\logs\, type server1\extend$n.log in the Log file mask box.
  • If the Log path is e:\logs\, type server$n\extend$n.log in the Log file mask box.

See Also

Configuring an Application

Adding a Non-Commerce Application to a Site

Copyright © 2005 Microsoft Corporation.
All rights reserved.