• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
asl_search() no longer returns old messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asl_search() no longer returns old messages


  • Subject: asl_search() no longer returns old messages
  • From: Karl Moskowski <email@hidden>
  • Date: Mon, 3 Nov 2008 11:01:44 -0500

Last week, I started converting my app to use ASL, and everything was hunky dory. For diagnostic purposes, I use an ASL query to export to text for upload recent logs.

// really, days & flag are passed in to a method
double days = 30.0; // varies from 1.0 to 30.0
NSString *minLevel = [NSString stringWithFormat:@"%u", (flag ? ASL_LEVEL_ERR : ASL_LEVEL_NOTICE)];


NSCalendarDate *startDate = [NSCalendarDate dateWithTimeIntervalSinceNow:-24.0*60.0*60.0*days];
NSString *logSince = [NSString stringWithFormat:@"%.0f", [startDate timeIntervalSince1970]];


aslmsg query = asl_new(ASL_TYPE_QUERY);
asl_set_query(query, ASL_KEY_SENDER, "MyApp", ASL_QUERY_OP_EQUAL);
asl_set_query(query, ASL_KEY_TIME, [logSince UTF8String], ASL_QUERY_OP_GREATER_EQUAL);
asl_set_query(query, ASL_KEY_LEVEL, [minLevel UTF8String], ASL_QUERY_OP_LESS_EQUAL | ASL_QUERY_OP_NUMERIC);
aslresponse response = asl_search(client, query);
asl_free(query);
aslmsg message = NULL;
while ((message = aslresponse_next(response)) != NULL) {
// format and append the message
}
aslresponse_free(response);
asl_close(client);
// return the message


Today, I fired up Xcode to continue working, and I noticed my queries no longer return any messages before this morning's reboot.

The only thing I can think of is that, since last week, the periodic weekly script ran this morning. Does this script prune the ASL database? Is there another way to go further back in time with ASL?

TIA.

----
Karl Moskowski <email@hidden>
Voodoo Ergonomics Inc. <http://voodooergonomics.com/>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: asl_search() no longer returns old messages
      • From: Jason Coco <email@hidden>
  • Prev by Date: Re: External Program Control from within Cocoa App
  • Next by Date: Re: Lack of Initializers or Factory Methods
  • Previous by thread: Re: Lack of Initializers or Factory Methods
  • Next by thread: Re: asl_search() no longer returns old messages
  • Index(es):
    • Date
    • Thread