
Quoting
California Code of Civil Procedure, Sec. 726.
(a) There can be but one form of action for the recovery of any debt or the enforcement of any right secured by mortgage upon real property or an estate for years therein, which action shall be in accordance with the provisions of this chapter. In the action the court may, by its judgment, direct the sale of the encumbered real property or estate for years therein (or so much of the real property or estate for years as may be necessary), and the application of the proceeds of the sale to the payment of the costs of court, the expenses of levy and sale, and the amount due plaintiff, including, where the mortgage provides for the payment of attorney's fees, the sum for attorney's fees as the court shall find reasonable, not exceeding the amount named in the mortgage.
(b) The decree for the foreclosure of a mortgage or deed of trust secured by real property or estate for years therein shall declare the amount of the indebtedness or right so secured and, unless judgment for any deficiency there may be between the sale price and the amount due with costs is waived by the judgment creditor or a deficiency judgment is prohibited by Section 580b, shall determine the personal liability of any defendant for the payment of the debt secured by the mortgage or deed of trust and shall name the defendants against whom a deficiency judgment may be ordered following the proceedings prescribed in this section. In the event of waiver, or if the prohibition of Section 580b is applicable, the decree shall so declare and there shall be no judgment for a deficiency. In the event that a deficiency is not waived or prohibited and it is decreed that any defendant is personally liable for the debt, then upon application of the plaintiff filed at any time within three months of the date of the foreclosure sale and after a hearing thereon at which the court shall take evidence and at which hearing either party may present evidence as to the fair value of the real property or estate for years therein sold as of the date of sale, the court shall render a money judgment against the defendant or defendants for the amount by which the amount of the indebtedness with interest and costs of levy and sale and of action exceeds the fair value of the real property or estate for years therein sold as of the date of sale. In no event shall the amount of the judgment, exclusive of interest from the date of sale and of costs exceed the difference between the amount for which the real property or estate for years therein was sold and the entire amount of the indebtedness secured by the mortgage or deed of trust. Notice of the hearing shall be served upon all defendants who have appeared in the action and against whom a deficiency judgment is sought, or upon their attorneys of record, at least 15 days before the date set for the hearing. Upon application of any party made at least 10 days before the date set for the hearing the court shall, and upon its own motion the court at any time may, appoint one of the probate referees provided for by law to appraise the real property or estate for years therein sold as of the time of sale. The probate referee shall file the appraisal with the clerk and the appraisal is admissible in evidence. The probate referee shall take and subscribe an oath to be attached to the appraisal that the referee has truly, honestly and impartially appraised the real property or estate for years therein to the best of the referee's knowledge and ability. Any probate referee so appointed may be called and examined as a witness by any party or by the court itself. The court shall fix the compensation, in an amount as determined by the court to be reasonable, but the fees shall not exceed similar fees for similar services in the community where the services are rendered, which may be taxed and allowed in like manner as other costs.
* * *