switch to a new logging framework (Log4Net) (1 Viewer)

Bavarian

Retired Team Member
  • Premium Supporter
  • April 4, 2005
    698
    167
    Germany, Bayern
    Home Country
    Germany Germany
    Description of the change

    The logging for MediaPortal and TVServer is switched to log4net.
    • We now have an unique format all over MP1
    • The TVplugin is now logging into MediaPortal.log and no longer in TV.log
    • Log files have now the names of their running program (MediaPortal.exe -> MediaPortal.log)
    • The Error.log is now renamed to MediaPortal-Error.log
    Code:
    https://github.com/MediaPortal/MediaPortal-1/branches/FEAT-3273-Switch_to_log4net
     
    Last edited by a moderator:

    infinite.loop

    Retired Team Member
  • Premium Supporter
  • December 26, 2004
    16,163
    4,133
    127.0.0.1
    Home Country
    Austria Austria
    Nice work bavarian!
    Did a clean install of just MP.
    Basic install seems to be working fine. :)

    A few things based on what I thought to remember from the goals of the new logging framework.

    What I noticed is:
    • logfiles can nolonger be deleted while the application is running - they are "locked"
    • when using MediaPortalDirs.xml to define a different loging folder, evr.log, TsReader - [date].log, etc. are still logged into the default folder C:\ProgramData\Team MediaPortal\MediaPortal\log
    What I am missing is:
    • Configurable value log recycling (max number of log files to keep) and rotating (create new logfile every X hours) for MediaPortal and TV-Server to avoid 100MB+ huge logs
    • loglevels for the TVServer (including filters using the loglevels)
    • configureable logpath for server (MediaPortalDirs.xml does not exist for Server)
    I think for the changes to the filters we need janne, and the others in here. :)

    *update*
    Just installed TVSeries and FanartHandler. Working well - no issues.
     

    Bavarian

    Retired Team Member
  • Premium Supporter
  • April 4, 2005
    698
    167
    Germany, Bayern
    Home Country
    Germany Germany
    Thank you for testing :D


    What I noticed is:
    • logfiles can nolonger be deleted while the application is running - they are "locked"
    • when using MediaPortalDirs.xml to define a different loging folder, evr.log, TsReader - [date].log, etc. are still logged into the default folder C:\ProgramData\Team MediaPortal\MediaPortal\log
    • The "lock" can be changed in the log4net.config file -> details will follow
    • The logs you have mentioned are coming from the C++ side and this was not part of this mantis entry
    What I am missing is:

    • Configurable value log recycling (max number of log files to keep) and rotating (create new logfile every X hours) for MediaPortal and TV-Server to avoid 100MB+ huge logs
    • loglevels for the TVServer (including filters using the loglevels)
    • configureable logpath for server (MediaPortalDirs.xml does not exist for Server)
    • log cycling, rotations are handeled via the log4net.config file, currently I have set up 1MB, 5 cycles and start new logs on every start of program
    • configable loglevels and logpaths where not mentioned in the mantis entry, I can implement it when you create a mantis entry for it and assign it to me ;)
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    when using MediaPortalDirs.xml to define a different loging folder, evr.log, TsReader - [date].log, etc. are still logged into the default folder C:\ProgramData\Team MediaPortal\MediaPortal\log

    It is quite big amount of time it would require to change the C++ side to use (with some proxy maybe) the same logging framework as C# side is using.
     

    infinite.loop

    Retired Team Member
  • Premium Supporter
  • December 26, 2004
    16,163
    4,133
    127.0.0.1
    Home Country
    Austria Austria
    I think I need to find that thread we have in the internal section which had all the ToDo/Wishlist points for the logging rework. :)
     

    ronilse

    Retired Team Member
  • Premium Supporter
  • July 19, 2005
    4,422
    283
    Moss
    Home Country
    Norway Norway
    Hi,
    Been testing this for some hours & seems good after some start & stop(8) i have 5.log* & one -log which is fine, but why is there empty error.log's. Does it have to make those empty ones on start?

    Regards
    Roy
     

    ronilse

    Retired Team Member
  • Premium Supporter
  • July 19, 2005
    4,422
    283
    Moss
    Home Country
    Norway Norway

    Bavarian

    Retired Team Member
  • Premium Supporter
  • April 4, 2005
    698
    167
    Germany, Bayern
    Home Country
    Germany Germany
    Hi,
    Been testing some more today & Configuration.log doesn't seem to rotate every 1MB(have it on 1,4MB now). I don't know how it is for rest of the logs when it comes to that(not had any that high).

    In test i use the source found on https://github.com/MediaPortal/MediaPortal-1/branches/FEAT-3273-Switch_to_log4net

    Hi Roy,
    Thank you for testing.
    The source is correct. About the 1,4MB I will check later today (maybe it is only a config setting).
    The empty Error log is coming from log4net at the start and can not be avoided.

    Cheers,
    Manfred
     

    Users who are viewing this thread

    Top Bottom