function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
venkateshvenkatesh 

Log file generation Through APEX API

HI ALL,

Is the any methods in Apex API , so i can generate log files as per my conditions when my application in running within force.com platform. Please reply asap ..anyone ..thnx 

Best Answer chosen by Admin (Salesforce Developers) 
jeffdonthemicjeffdonthemic

You can create a custom object in Salesforce.com which is the database table. Then you write your message to this custom object/table in Salesforce.com using Apex, SOAP calls, etc.

 

You wouldn't need an external datastore.

 

 

HTH

 

Jeff Douglas

Informa Plc

http://blog.jeffdouglas.com

All Answers

jeffdonthemicjeffdonthemic

Natively no. However you could create a custom object and write your log contents to that object. You would need to ensure that the appropriate profiles have rights to it.

 

Good luck

 

Jeff Douglas

Informa Plc

http://blog.jeffdouglas.com

venkateshvenkatesh
thnx
venkateshvenkatesh
ok can you provide me some links or sample examples to acheive that log file by setting into an Apex object??
jeffdonthemicjeffdonthemic

The process is that you would create a new custom object with the fields you would like for your log (eg errorMessage, processType, location, sverity, etc.). And then everytime you catch an error or warning, parse the error and insert a new object into your error log table.

 

Jeff Douglas

Informa Plc

http://blog.jeffdouglas.com

venkateshvenkatesh
ok i understood that , but again question is the error log table in which side Salesforce or my DB.
jeffdonthemicjeffdonthemic

You can create a custom object in Salesforce.com which is the database table. Then you write your message to this custom object/table in Salesforce.com using Apex, SOAP calls, etc.

 

You wouldn't need an external datastore.

 

 

HTH

 

Jeff Douglas

Informa Plc

http://blog.jeffdouglas.com

This was selected as the best answer
venkateshvenkatesh
thnx