19: BEGIN
20: -- p_force writes to log even if debug is No. Used in case of abnormal exceptions.
21: IF (p_Debug='Y') OR (p_force='Y') THEN
22: l_msg := TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS') || ' ' || substr(p_msg, l_start, 234);
23: FND_FILE.PUT_LINE(FND_FILE.LOG, l_msg);
24: l_length := length(p_msg)-255;
25: l_start := l_start + 234;
26: WHILE l_length > 234 LOOP
27: l_substring := substr(p_msg, l_start, 234);
25: l_start := l_start + 234;
26: WHILE l_length > 234 LOOP
27: l_substring := substr(p_msg, l_start, 234);
28: --DBMS_OUTPUT.PUT_LINE(l_substring);
29: FND_FILE.PUT_LINE(FND_FILE.LOG, l_prefix || l_substring);
30: l_start := l_start + 234;
31: l_length := l_length - 234;
32: END LOOP;
33: --DBMS_OUTPUT.PUT_LINE(l_substring);
30: l_start := l_start + 234;
31: l_length := l_length - 234;
32: END LOOP;
33: --DBMS_OUTPUT.PUT_LINE(l_substring);
34: FND_FILE.PUT_LINE(FND_FILE.LOG, l_substring);
35: END IF;
36:
37: EXCEPTION
38: WHEN others THEN
35: END IF;
36:
37: EXCEPTION
38: WHEN others THEN
39: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Exception: others in Write_log');
40: FND_FILE.PUT_LINE(FND_FILE.LOG,
41: 'SQLCODE ' || to_char(SQLCODE) ||
42: ' SQLERRM ' || substr(SQLERRM, 1, 100));
43:
36:
37: EXCEPTION
38: WHEN others THEN
39: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Exception: others in Write_log');
40: FND_FILE.PUT_LINE(FND_FILE.LOG,
41: 'SQLCODE ' || to_char(SQLCODE) ||
42: ' SQLERRM ' || substr(SQLERRM, 1, 100));
43:
44: END Write_Log;