Menu

logrotate: Unable to parse test as an int32, skipping...

2019-04-12
2019-04-12
  • Rahul Dankhara

    Rahul Dankhara - 2019-04-12

    Getting error as above.

    Here is my logrotate.conf file.
    ...................................................
    C:\logs\test.log {
    daily
    rotate 10
    }
    ...................................................
    Output of my command:

    .\logrotate.exe -f -v -d 'C:\Program Files (x86)\Ken Salter\LogRotate\Content\logrotate.conf'

    ........................
    PS C:\Program Files (x86)\Ken Salter\LogRotate> .\logrotate.exe -f -v -d 'C:\Program Files (x86)\Ken Salter\LogRotate\Content\logrotate.conf'
    logrotate: Force option set to true
    logrotate: logrotate 0.0.0.18 - Copyright (C) 2012-2016 Ken Salter
    logrotate: Verbose option set to true
    logrotate: Debug option set to true
    logrotate: Verbose option set to true
    logrotate: C:\Program Files (x86)\Ken Salter\LogRotate\Content\logrotate.conf Adding to config files to process
    logrotate: Parsing configuration file C:\Program Files (x86)\Ken Salter\LogRotate\Content\logrotate.conf
    logrotate: read line # sample logrotate configuration file
    logrotate: Skipping comment
    logrotate: read line
    logrotate: read line # uncomment to enable compression of rotated log files
    logrotate: Skipping comment
    logrotate: read line # compress
    logrotate: Skipping comment
    logrotate: read line
    logrotate: read line # this example will rotate the c:\test.log file daily and keep 5 rotations.
    logrotate: Skipping comment
    logrotate: read line # there is also an example prerotate script that will print the current time and the parameter passed to it (which is the path to the log file)
    logrotate: Skipping comment
    logrotate: read line C:\logs\test.log {
    logrotate: Processing new section
    logrotate: Will process file path C:\logs\test.log
    logrotate: read line daily
    logrotate: Setting daily to True
    logrotate: read line rotate 10
    logrotate: Setting rotate to 10
    logrotate: read line }
    logrotate: read line
    logrotate: Processing C:\logs\test.log
    logrotate: Force option is set, will rotate
    logrotate: Rotating file C:\logs\test.log
    logrotate: Rotate will be simulated because Debug is true
    logrotate: Examining filename test.log.txt
    logrotate: Unable to parse test as an int32, skipping...
    logrotate: Renaming C:\logs\test.log to C:\logs\test.log.1
    logrotate: Compressing rotated log file C:\logs\test.log.1
    PS C:\Program Files (x86)\Ken Salter\LogRotate>
    .......................................................

    Can you please help?

     

    Last edit: Rahul Dankhara 2019-04-12
  • Rahul Dankhara

    Rahul Dankhara - 2019-04-12

    After changing path in ogrotate.conf as below, the int32 error went off but still it is not rotating test file.
    ...................
    C:\logs path contains below files

    test.log
    testing.log
    ......................

    C:\logs\test* {
    daily
    rotate 10
    }

    ....................................................
    PS C:\Program Files (x86)\Ken Salter\LogRotate> .\logrotate.exe -f -v -d 'C:\Program Files (x86)\Ken Salter\LogRotate\Content\logrotate.conf'
    logrotate: Force option set to true
    logrotate: logrotate 0.0.0.18 - Copyright (C) 2012-2016 Ken Salter
    logrotate: Verbose option set to true
    logrotate: Debug option set to true
    logrotate: Verbose option set to true
    logrotate: C:\Program Files (x86)\Ken Salter\LogRotate\Content\logrotate.conf Adding to config files to process
    logrotate: Parsing configuration file C:\Program Files (x86)\Ken Salter\LogRotate\Content\logrotate.conf
    logrotate: read line # sample logrotate configuration file
    logrotate: Skipping comment
    logrotate: read line
    logrotate: read line # uncomment to enable compression of rotated log files
    logrotate: Skipping comment
    logrotate: read line # compress
    logrotate: Skipping comment
    logrotate: read line
    logrotate: read line # this example will rotate the c:\test.log file daily and keep 5 rotations.
    logrotate: Skipping comment
    logrotate: read line # there is also an example prerotate script that will print the current time and the parameter passed to it (which is the path to the log file)
    logrotate: Skipping comment
    logrotate: read line C:\logs\test {
    logrotate: Processing new section
    logrotate: Will process file path C:\logs\test

    logrotate: read line daily
    logrotate: Setting daily to True
    logrotate: read line rotate 10
    logrotate: Setting rotate to 10
    logrotate: read line }
    logrotate: read line
    logrotate: Processing C:\logs\test*
    logrotate: Processing C:\logs\test.log.txt
    logrotate: Force option is set, will rotate
    logrotate: Processing C:\logs\testing.log.txt
    logrotate: Force option is set, will rotate
    logrotate: Rotating file C:\logs\test.log.txt
    logrotate: Rotate will be simulated because Debug is true
    logrotate: Renaming C:\logs\test.log.txt to C:\logs\test.log.txt.1
    logrotate: Compressing rotated log file C:\logs\test.log.txt.1
    logrotate: Rotating file C:\logs\testing.log.txt
    logrotate: Rotate will be simulated because Debug is true
    logrotate: Renaming C:\logs\testing.log.txt to C:\logs\testing.log.txt.1
    logrotate: Compressing rotated log file C:\logs\testing.log.txt.1
    ..............................................

     
  • Rahul Dankhara

    Rahul Dankhara - 2019-04-12

    Tried same thing in cmd as admin and getting different error:

    C:\Program Files (x86)\Ken Salter\LogRotate>.\logrotate.exe -f -d -v 'C:\Program Files (x86)\Ken Salter\LogRotate\Content\logrotate.conf'
    logrotate: Force option set to true
    logrotate: Debug option set to true
    logrotate: Verbose option set to true
    logrotate: logrotate 0.0.0.18 - Copyright (C) 2012-2016 Ken Salter
    logrotate: Verbose option set to true
    logrotate: 'C:\Program Adding to config files to process
    logrotate: Files Adding to config files to process
    logrotate: (x86)\Ken Adding to config files to process
    logrotate: Salter\LogRotate\Content\logrotate.conf' Adding to config files to process
    logrotate: Exception: The given path's format is not supported.
    logrotate: StackTrace: at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
    at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
    at System.IO.File.GetAttributes(String path)
    at logrotate.Program.ProcessConfigPath(String m_path)
    at logrotate.Program.Main(String[] args)

    C:\Program Files (x86)\Ken Salter\LogRotate>

     

Log in to post a comment.