Limit log size

Post Reply
User avatar
hotbrass
Posts: 35
Joined: Sat Jan 11, 2020 8:40 pm

Limit log size

Post by hotbrass »

Is there a way to limit the log file size in BI5?
User avatar
Thixotropic
Posts: 744
Joined: Wed Sep 04, 2019 7:20 pm
Location: Low-Earth Orbit

Re: Limit log size

Post by Thixotropic »

The manual includes this on page 144:

"By default, a new log file is created each month to prevent it from growing too large.
For your convenience a View log button is provided. These files are not otherwise managed
and will eventually use considerable disc space. Please be sure to prune this folder on
occasion as required.
"

So, it looks like there's no way to limit the log natively.

I suppose you could use a Powershell script to delete some or all of the files every so often. The script below could do it with minor modifications.

Code: Select all

# Delete all Files in C:\path\to\blue\iris\logs older than 30 day(s)
$Path = "C:\path\to\blue\iris\logs"
$Daysback = "-30"
 
$CurrentDate = Get-Date
$DatetoDelete = $CurrentDate.AddDays($Daysback)
Get-ChildItem $Path | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item


hotbrass wrote: Fri Jan 31, 2020 5:02 pm Is there a way to limit the log file size in BI5?
Blue Iris 5.x x64 | Windows 10 Pro x64 | 16GB RAM | i7-7700 3.6 GHz | 1TB HDD | 2TB RAID NAS | 9 Cameras | Almost Dual NIC | 2KVA UPS
User avatar
Thixotropic
Posts: 744
Joined: Wed Sep 04, 2019 7:20 pm
Location: Low-Earth Orbit

Re: Limit log size

Post by Thixotropic »

For what it's worth, my January log ended up being about 18 megs. I don't know specifically what's being logged, mine is still set to whatever the default is.

At ~20 megs per month that'd be 240M per year. Not too bad. That's not a lot of storage these days but I could see where over time or with lots of cameras and events being logged, it could definitely eat up some space.

I'm more concerned that opening the file, writing to it, and then closing it would take some time and CPU cycles, maybe cause some hiccups. I think I'll write a Powershell script that runs daily to check the overall size of the directory, and then prune older files if it's over a certain size.

Another little task to do, lol. :)
Blue Iris 5.x x64 | Windows 10 Pro x64 | 16GB RAM | i7-7700 3.6 GHz | 1TB HDD | 2TB RAID NAS | 9 Cameras | Almost Dual NIC | 2KVA UPS
User avatar
hotbrass
Posts: 35
Joined: Sat Jan 11, 2020 8:40 pm

Re: Limit log size

Post by hotbrass »

I dont really care about the size. Lots of disk space on my computer. I would like it more if I could set a size limit or time limit. I am only interested in less than a day or so. My general needs are immediate and not with the archival of long past events. I only keep 3 days of recording unless there is something I feel is important from a security standpoint. Right now I just trim it down when I need to look at it for some reason, not very often.
MikeBwca
Posts: 1083
Joined: Thu Jun 20, 2019 5:39 am

Re: Limit log size

Post by MikeBwca »

hotbrass wrote: Sat Feb 01, 2020 9:30 pm ...
lol. I actually thought there was a bug on my screen and tried to swoosh it away!
User avatar
hotbrass
Posts: 35
Joined: Sat Jan 11, 2020 8:40 pm

Re: Limit log size

Post by hotbrass »

MikeBwca wrote: Sun Feb 02, 2020 2:28 am
hotbrass wrote: Sat Feb 01, 2020 9:30 pm ...
lol. I actually thought there was a bug on my screen and tried to swoosh it away!
LOL! I've had that bug since 2005! Always good for a laugh.
Post Reply