How to change Redis Log timestamp format - lua

I'm using lua script to run redis commands and use {{redis.log()}} in it. It prints the format as mentioned below. But I wanted to change to time format in the log. i.e dd-MM-yyyy HH:mm:ss.SSS instead of default format (dd MMM hh:MM:ss.SSS which I assume)
Format:
[pid] date loglevel message
For instance:
[4018] 14 Nov 07:01:22.119 * Background saving terminated with success
How can I do this?

Regrettably, no, there are no "user serviceable" knobs for this. The output to the log is always preceded by a timestamp in the hardcoded format that's specified in server.c:
off = strftime(buf,sizeof(buf),"%d %b %H:%M:%S.",localtime(&tv.tv_sec));

Related

Oracle Report stuck in post processing when trying to generate a report

I am creating a Oracle Report. The report is supposed to take a bunch of input and create the report. It is not working for some specific cases.
The input are as follows
1. Account number
2.org id
3. start _date
4.end date
the report is supposed to generate a report for the org_id(constant) based on the account number and for date between start date and end date.
When the account_number is not provided it will return all the information regarding all accounts.
It works when I give specific account information
It works for specific dates (10-jan-25th jan ,20thjan-31st-jan) with out any account number: i.e. it returns information about all account number for given time period.
but it fails to give me information about 10-jan-31st jan. Which I can not figure out why.
I have tried to get the xml and put it in the template and create a preview,
the preview does not work and gives me the following error:
error: Conf File: C:\Template Builder for Word\config\xdo config.xml Font Dir: C:\Template Builder for Word\fonts Run XDO Start Template: C:\MyFiles\XML_Publisher\lATEST OUTPUT\XXONT_M193_CANCELLED_HOLDS .rtf RTFProcessor setLocale: en-us FOProcessor setData: C:\MyFiles\XML_Publisher\Test\errchk15jan7feb.xml FOProcessor setLocale: en-us
With the longer date range, the XML file might be too big for the output postprocessor. Did you check the size of the XML file?
If this is the problem, you can use our company's Blitz Report, which doesn't have size limitations: https://www.enginatics.com/faq/#how-does-blitz-report-compare-with-oracle-bi-publisher

Unison fails because it cannot set time stamp

Trying to sync from a mac to a linux machine, I get multiple failures with a message of the following type:
100% 00:00 ETAFailed [www/sandbox/my-vue-buefy-project/node_modules/spdy-transport/lib/spdy-transport/protocol/spdy]:
Failed to set modification time of file /users/guerrini/www/sandbox/my-vue-buefy-project/node_modules/spdy-transport/lib/spdy-transport/protocol/.unison.spdy.1db0b477154fc6ddf40346e8e27082da.unison.tmp/constants.js
to 1970-01-01 at 1:00:00 (0.000000):
the time was set to 2018-04-12 at 8:49:57 (1523515797.000000) instead`
It seems that it cannot set the modification time and that it uses the current time instead. But, unfortunately, after this the synchronisation of all the files with the above modification date fails.
Moreover, I have tried to set modification date to the given time by hand with "touch" and it works.

Apple System Log time in milliseconds?

NSLog() uses timestamps with millisecond resolution, but is a blunt instrument because all its log messages are at the Warning level.
Apple System Log is a much more fine-grained system, with 8 different levels. BUT... its timestamps have only 1-second resolution. I read the man page about time formats, but they all seem to be to the second only.
Clearly this information is available, at least to NSLog. A lot can go on in a second; is there a way to get better resolution with ASL?
You can append ".#" to the time format in ASL (and syslog) to specify the precision. Thus "utc.3" would format in UTC format with milliseconds. You can add this to both the msg_fmt or time_fmt arguments.
Time format precision appears to only be documented in syslogd(1). I am not sure why it didn't make it to asl(3).
For example, using asl_add_output_file and specifying in the time_fmt might look like this:
// setup, do once!
aslclient log = asl_open(NULL, NULL, 0);
asl_add_output_file(log, STDERR_FILENO,
"$Time $((Level)(str)) - $Message", // $Time here uses time_fmt arg on next line
ASL_TIME_FMT_UTC ".3", // time_fmt: append ".3" for milliseconds here
ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG), ASL_ENCODE_SAFE);
// example log
asl_log(log, NULL, ASL_LEVEL_INFO, "Hello");
// Note in the above ASL_TIME_FMT_UTC is #defined to "utc", so the we're
// using compile-time string concatenation of "utc" ".3" to "utc.3".
// Alternately you can just specify "utc.3" directly.
and output:
2016-02-01 19:16:39.561Z Info - Hello
Specifying in msg_fmt argument of asl_add_output_file might look like this:
// setup, do once!
aslclient log = asl_open(NULL, NULL, 0);
asl_add_output_file(log, STDERR_FILENO,
// in msg_fmt below, use ISO8601 + ".6" for microseconds
"$((Time)(ISO8601.6)) $((Level)(str)) - $Message",
ASL_TIME_FMT_UTC,
ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG), ASL_ENCODE_SAFE);
// example log
asl_log(log, NULL, ASL_LEVEL_INFO, "Hello");
and output:
2016-02-01T14:16:39.562030-05 Info - Hello
(I would caution that the above snippets of code are only meant to demonstrate specifying the time format precision in ASL. Actual usage should likely involve a dispatch_once for setup, use a serial dispatch queue for logging.)
Use ts shell command to add milliseconds to any log.
idevicesyslog | ts '[%Y-%m-%d %H:%M:%.S]'

php 5.2.17 date('T') gives incorrect timezone. Server time+phpinfo time are correct

I am having a bit of a weird issue:
the date function gives timezone=MST
the date function from the centOS prompt gives me EST
the phpinfo() function returns America/New_York
As Plesk was showing America/New_York but centOS was not, Techsupport did something to the
/usr/share/zoneinfo/ files, because they said that somehow the New_York file was showing MST (Mountain Time).
After that operation, centOS time and phpinfo() display EST correctly but the date function still display MST.
Any ideas?
Did you tried date_default_timezone_set()?
Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.

Retrieved JSON contains [0.0] randomly in the data

I've been retrieving json from my web service, with the data containing [0.0] in odd places, such as in the middle of "tit[0.0] le". I'm viewing the info in the console, so I just ignored it as when I actually use it it is not present.
However, I'm currently building a calendar and placing the retrieved events in it. The problem with a particular event is that the [0.0] seems to be lodged in between the timestamp 2012-03-[0.0] 01T00:00:00. It's only happening with this event that the [0.0] is not going away when I use it. Of course, the httpdateparser cant retrieve the date properly, with it interpreting it a day early. I think the [0.0] is the cause.
How do I get rid of the [0.0]? parse it out? I don't think it is actually there...
EDIT:
it looks like the [0.0] are just added by the blackberry console for viewing purposes.
But why is it only on the two events that are not working correctly?
full_date:2012-02-29T00:00:00
full_date:2012-03-01T00:00:00
Both these dates are parsed using the following:
Date date = new Date(HttpDateParser.parse(date_full));
c.setTime(date);
int theMonth = c.get(Calendar.MONTH);
int theYear = c.get(Calendar.YEAR);
int theDate = c.get(Calendar.DAY_OF_MONTH);
For theDate I get feb 28 and 29 respectively. Does this have to do with leap years? I thought Calendar delt with this stuff?
Check the list of valid date formats on the API. I found "yyyy-MM-ddThh:mm:ssTZD" (eg 1997-07-16T19:20:30+01:00) is on it. Maybe you need to append timezone information.
[EDITED]
Adjusting the date comes from web service to the device timezone may fix the problem. When calender.get(property) is invoked it considers device timezone.

Resources