Jump to content
Salesforce and other SMB Solutions are coming soon. ×

log compilation


beju0506
 Share

Recommended Posts

Hi everyone!

 

Here is the issue:

 

We have an audit log system set up on our DB. Each table has a field that contains the log data, so each record has a separate log. We're trying to use a script to compile the data from each record into either a single record in a different table (i.e. log table) or into multiple records (one for each collection of the logs)... The problem is, when we collect the log data, it gets pasted into one text field (which is rather large at the end). When we try to go view this data, it crashes FM (FM Pro 8 Adv)... So obviously we're dealing with a memory issue. But we're at a loss as to what to do. We need to have the data all in one spot, so having a separate log record for each record in the DB doesn't work. And FM crashes with only copying the log data from one table, so we're not sure where to go... Basically we'd like to have it where the log records are labeled with the table names in a name field so we can associate them back later on.

I know, it sounds nutty lol...

 

Thanks!

 

Justin

Link to comment
Share on other sites

knowledge base:

 

Text: Up to 1 billion characters per field per repetition (limited by available memory) with optional text style runs and paragraph runs.

 

how large are these log fields typically? they'd have to be really big to hold a billion characters. maybe file cache is set too small?

btw if the log fields are large, the cf in the other post could get in trouble if there are 50.000+ lines. Nevertheless, that's a lot of record modification.

 

kjoe

Link to comment
Share on other sites

Kjoe -

 

Well, the text is large... but I think the issue is really with local memory...

What we've got is that each record in the table has between zero lines and 1 page of log text. We've got like 285 records... So we're trying to find a practical way of compiling it into one separate log table and practically viewing it... I dunno... any suggestions?

Link to comment
Share on other sites

From your posts I gather that you want to view log entries both on a per user basis and on a per record basis. A separate log table would be practical then. Building it on the fly would mean scripting all data entry and modification. That would have impact on the UI for sure but might be worth considering.

 

compiling after the fact would be feasible also. You'd have to parse out the fields one line, one record and then parse out the lines to userID, timestamp, recordID, and log text. The latter can be calculated as the log lines are all the same structure, the former is a loop script.

It would be advisable to clear the log fields after compiling... you'd have redundant information anyhow and it would spare you the hassle of keeping track which log entries were already compiled.

 

kjoe

Link to comment
Share on other sites

Kjoe-

 

The second option sounds sort of like what we want, but how would we go about doing that? because compiling the info from all of the records into one large wad of text crashes FM, we've (as of the moment) had to copy them into individual records in the Log table, then just search or browse through them. It works, but not the best solution. However, if having more than a few pages of text in a text field is going to make it crash, lol, then it may be the only solution we have hehe :)

Link to comment
Share on other sites

I think we're at cross purposes here. I thought what you had was a log field with a largish bit of text and you'd want to parse out the lines of the log field to individual records - one line of log text, one record - not put together large text fields into even larger ones. You can then treat them as any line items table, print them in a list, view them in a portal, export them, even "copy all records" into a huge clipboard. etc. Why do you want to see it in one big field?

 

btw the crashing seems a little worrying. have you seen this reported elsewhere?

 

kjoe

Link to comment
Share on other sites

I am going to Plug my friend Ray a couple times in this post

 

1 st see Super Log at

http://www.nightwing.com.au/FileMaker/demos.html

 

Next

 

See Ray Audit Tracker at

 

http://www.nightwing.com.au/FileMaker/demos7/AuditTracker.zip

 

 

 

 

Taking Ray's Audit tracker a step farther and Setting it up in

each table.... I then created another field called

 

cAll_Logs = calcultion , Unstored =

 

 

If(IsEmpty ( Log_Txt) ;"";

TextStyleAdd ( "Contacts" ; Bold) & "¶" &

TextSize ( Log_Txt ;11 ) & "¶" ) &

 

If(IsEmpty ( Accounting::Log_Txt) ;"";

TextStyleAdd ( "Accounting" ; Bold) & "¶" &

TextSize ( Accounting::Log_Txt ;11 ) & "¶" ) &

 

If(IsEmpty ( Accounting Notes::Log_Txt) ;"";

TextStyleAdd ( "Accounting Notes" ; Bold) & "¶" &

TextSize ( Accounting Notes::Log_Txt;11) & "¶" )

 

Here you see I only included 3 tables ....but I use many more in the file.

Also you see I control the size and Font in each table.

 

Now a Script

 

set a global field to the contents of the current record using the

cAll_Logs field

 

 

Now you see all logs for all tables in 1 field

Link to comment
Share on other sites

Kjoe: The situation is that each record includes one field that contains the log for that record. We want to have some way of dumping all of the logs from all of the records into one text field in another table (a log table). The idea is that if we want to print out all of the logs or search through them at some point, its difficult in the form that they are in (text fields in each record). Ideally we would like to be able to sort them by user, or by record, etc, but that may be asking too much.

 

Chopper: I believe we're using the audit tracker from nightwing, but the superlog we couldn't get to work properly. (or there was some issue involved in its implementation that wasn't compatible with what we have set up, I don't remember, its been quite a while :)) As for what you showed me there, I'm not sure I understand how it works... can you go through it for me? I'm still kinda new to FM :)

Link to comment
Share on other sites

Kjoe - Here's a different idea: Can we take selected lines out of each of the texts from the record (i.e. ones for a particular user, like the calc you gave me before) and then cut and paste them into a log record created for a particular user in another table?

Link to comment
Share on other sites

here's a sample of what I was thinking about in post #4 and #6. one log line, one record. please note that this is 180° the opposite of chopper's suggestion, if i understand correctly his procedure does end up with one large text field with all log items from all records in all tables. I believe I quote him correctly in saying "there are more ways to skin a cat". whichever suits you fine, poor cat. :P

 

kjoe

Link to comment
Share on other sites

Kjoe -

 

Wow... I never thought about doing it that way... I have to chew that over a bit and see how I can use your example. I'm not completely clear on how it works, but I really kinda like that method! smiley-laughing

I think that may solve my issue and get the results I want :)

 

I'll write back and let you know if it worked or not :)

 

Thanks again!

 

Justin

Link to comment
Share on other sites

Kjoe-

 

Works like a charm! That is really cool! I guess I should really brush up on my use of text in FM... seems like all the functions are there, its just a matter of how to use it! :)

 

Thanks again!

 

Justin

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use