• Log File

    From ahsan iqbal@21:1/5 to All on Wed May 31 00:22:11 2023
    Why we need a log file ? If i read a large text file than how log file help me in this regard?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tobiah@21:1/5 to ahsan iqbal on Wed May 31 06:31:20 2023
    On 5/31/23 00:22, ahsan iqbal wrote:
    Why we need a log file ? If i read a large text file than how log file help me in this regard?

    If you were parsing each line of this text file looking for information, perhaps some of the lines would not be formatted correctly, and you would be unable
    to get the information from those lines. Maybe you would like to
    write those bad lines to a log file so that you could analyze them later.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter J. Holzer@21:1/5 to ahsan iqbal on Thu Jun 1 00:52:14 2023
    On 2023-05-31 00:22:11 -0700, ahsan iqbal wrote:
    Why we need a log file ?

    A log file contains information about what your program was doing. You
    use it to check that your program was performing as intended after the
    fact. This is especially useful for tracking down problems with programs
    which are either long-running or are running unattended.

    For example, if a user tells me that they were having a problem
    yesterday evening I can read the log file to see what my program was
    doing at the time which will help me to pin down the problem.

    The important part to remember is that a log file will only contain
    information the program writes. If you didn't think to log some
    information then it won't be in the log file and you can't look it up afterwards. On the other hand you don't want to log too much information because that might cause performance problems, it might fill up your
    disks and it will be a chore to find the relevant information in a sea
    of irrelevant details. So deciding what to log is a bit of an art.

    If i read a large text file than how log file help me in this regard?

    It won't help you with reading the file.

    However, you might want to log some information about operation, e.g.
    when you started (log files usually contain time stamps), when you
    ended, how large the file was, etc. That way you can compare different
    runs (has the file increased in size over the last month? Was reading especially slow yesterday?). You could also log a status message every
    once in a while (e.g. every 100 MB or every 100000 lines). That will
    give you reassurance that the program is working and a rough estimate
    when it will be finished. Or you can log any other information you think
    might be useful.

    hp

    --
    _ | Peter J. Holzer | Story must make more sense than reality.
    |_|_) | |
    | | | hjp@hjp.at | -- Charles Stross, "Creative writing
    __/ | http://www.hjp.at/ | challenge!"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmR3z5kACgkQ8g5IURL+ KF2KKhAAiEygYLrn3EC7G9KUSVlGJpXUiM2liYBd+k+CNREKYR4y/1qyHc95CK6Y VuqWvBirxo9QEXVywJz2d7x/hUOoHb0G8lQc+xNt6wEtYngyoryO7tgw+qlCX8MK 0dT4Fieb/sYn7UnA1IyVw4cTlyp7gY+wopIoVjOytSSgnQOSPGrEME9zVSxc4W+l bjNEy8y/2wcJR7d17ceYhyCKC7qB0sDLktsPMz6cBAphz5cjspus9+c4yQQcxki+ 0wjZrO9EDLvbCrrV740SIdtHTpQcQ1CQnOofxL1SDAcpaGGNhEVmAosBkBfb9e+z DC9ehxR90eAPVH/JT6E5btW/15Q4c1H3tW7vfuiqLnUYy7+/pRZM346wE3qlFiFI 0fQzjwHxbRT77nK601xwOobrZy8tOuRlMgZj3jw1zqX0X/92JIaP4TRCrOgglIts 44vjMyuDHLemAbh5yvl6tfGG9Nsf7p35OLa5kJr1LlbwMjIQwebjGHA8twkPH0xl wedIdzjkBVf76hnMoOsEa2A6MYgi1eWMIZSvekCwJN9IOIr7KJOw7JXm3MYzBQ// zYgnpOEJIZb4TKmq9lwULrV7wHgcV5ScsLIcgGTEbC9IaT9IpMPlo4lwd+C+pWmI sLqBqOk7fkRtfYReOEP5XUTnb+1LQkb2rHcmxKz