Kaltura api_v3 logging

8 replies [Last post]
Joined: 09/02/2010
Points: 26

I've installed CE 2.0.2 on a dedicated server, and access looks to be fine. However, I notice that the file "kaltura_api_v3.log" that lives in kaltura/log/ gets to around 2Gb (yep 2 gig!) after a couple of days. From looking at it, it seems that there may be a DEBUG flag left on somewhere...

Any ideas as to what do I need to do to either reduce the logging that goes into this file, or just simply stop the thing from growing to ridiculous proportions?

TIA.

Joined: 09/28/2010
Points: 22

Hello,

i have same problem too, after a while kaltura_api_v3.log size reach 2GB and i cant login admin and KMC panels. IS there any flag to stop debugging.

Thanks,

Joined: 09/28/2010
Points: 22

Hello,

still kaltura_api_v3.log file reaches 2 GB in a few days and it does not deleted automatically, i remove it manually. Is there any way to remove it automatically or is there any settings to stop debugging.

Thanks,

Joined: 02/22/2009
Points: 97

first - kalturaCE 2.0.2 should add log-rotation configuration on your server.
is that not happening? are logs not rotated daily?
if not - this is a bug which need to be fixed.

for reducing log level, under folder:
app/api_v3/config
you will find logger.ini
in that, change the line
writers.stream.filters.priority.priority = 7
to a lower number as you wish
const EMERG = 0; // Emergency: system is unusable
const ALERT = 1; // Alert: action must be taken immediately
const CRIT = 2; // Critical: critical conditions
const ERR = 3; // Error: error conditions
const WARN = 4; // Warning: warning conditions
const NOTICE = 5; // Notice: normal but significant condition
const INFO = 6; // Informational: informational messages
const DEBUG = 7; // Debug: debug messages

this should lower log level.

Gonen.

Joined: 09/28/2010
Points: 22

Hello,

actually i'm not sure that logs rotated daily? After a few days i cant access kaltura admin panel. I checked the logs and output is below.
-rw-r--r-- 1 nobody nobody 2147483647 Oct 25 17:03 kaltura_api_v3.log

Note: I received an email everynight, "etljob file failed : Tue Oct 26 05:30:01 EEST 2010" subject and it says "kaltura access log couldnt be processed". I think i should solve this problem to slove log rotate problem. Do you have any suggestion to check file or directory permission?

I checked /opt/kaltura/app/api_v3/config/logger.ini but i couldnt find line which "writers.stream.filters.priority.priority = 7", can i add this line and other configuration parameters.

Thanks a lot,

Joined: 09/02/2010
Points: 26

I'm not sure the entry within the api_v3/logger.ini file does anything either... I'm still getting several hundred Mb of logfile daily.

However, to make it a little more manageable, I've added this into my crontab:

# rotate logs
01 4 * * * /usr/sbin/logrotate -f /etc/logrotate.conf >/dev/null 2>&1

That way, it breaks it into manageable chunks of .gz files rather than simply adding to an over-bloated log.

(note: make sure that /etc/logrotate.conf already includes the kaltura log directory - this should have been done during the CE installation process)

Joined: 08/30/2010
Points: 98

this is my logrotate.conf:

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}

/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}

# system-specific logs may be configured here

should I uncomment the compress
and is the log directory /opt/kaltura/log
how can I make a cron so that it deletes old log files?

Thanks

Joined: 09/02/2010
Points: 26

Hi;

>> should I uncomment the compress
I would - it makes your previous log files smaller and it's simple to view using gunzip if you need to...

>> and is the log directory /opt/kaltura/log
You can define which directories the rotation affects within the conf file thus:

/full/path/to/your/log/dir/here {
missingok
monthly
create 0660 root utmp
rotate 1
}

(as shown in the file)

>> how can I make a cron so that it deletes old log files?
You don't need to - it stores the previous x zipped files and overwrites once it reaches those amounts.

Joined: 08/30/2010
Points: 98

thanks a lot vslrnd!!