1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache license, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the license for the specific language governing permissions and 15 * limitations under the license. 16 */ 17 package org.apache.logging.log4j; 18 19 import org.apache.logging.log4j.message.Message; 20 import org.apache.logging.log4j.message.MessageFactory; 21 22 /** 23 * This is the central interface in the log4j package. Most logging 24 * operations, except configuration, are done through this interface. 25 * @doubt See LOG4J2-16. 26 */ 27 public interface Logger { 28 29 /** 30 * Logs an exception or error that has been caught. 31 * @param level The logging Level. 32 * @param t The Throwable. 33 */ 34 void catching(Level level, Throwable t); 35 36 /** 37 * Logs an exception or error that has been caught. 38 * @param t The Throwable. 39 */ 40 void catching(Throwable t); 41 42 /** 43 * Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level. 44 * 45 * @param marker the marker data specific to this log statement 46 * @param msg the message string to be logged 47 */ 48 void debug(Marker marker, Message msg); 49 50 /** 51 * Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level. 52 * 53 * @param marker the marker data specific to this log statement 54 * @param msg the message string to be logged 55 * @param t A Throwable or null. 56 */ 57 void debug(Marker marker, Message msg, Throwable t); 58 59 /** 60 * Logs a message object with the {@link Level#DEBUG DEBUG} level. 61 * 62 * @param marker the marker data specific to this log statement 63 * @param message the message object to log. 64 */ 65 void debug(Marker marker, Object message); 66 67 /** 68 * Logs a message at the {@link Level#DEBUG DEBUG} level including the 69 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 70 * 71 * @param marker the marker data specific to this log statement 72 * @param message the message to log. 73 * @param t the exception to log, including its stack trace. 74 */ 75 void debug(Marker marker, Object message, Throwable t); 76 77 /** 78 * Logs a message object with the {@link Level#DEBUG DEBUG} level. 79 * 80 * @param marker the marker data specific to this log statement 81 * @param message the message object to log. 82 */ 83 void debug(Marker marker, String message); 84 85 /** 86 * Logs a message with parameters at the {@link Level#DEBUG DEBUG} level. 87 * 88 * @param marker the marker data specific to this log statement 89 * @param message the message to log; the format depends on the message factory. 90 * @param params parameters to the message. 91 * @see #getMessageFactory() 92 */ 93 void debug(Marker marker, String message, Object... params); 94 95 /** 96 * Logs a message at the {@link Level#DEBUG DEBUG} level including the 97 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 98 * 99 * @param marker the marker data specific to this log statement 100 * @param message the message to log. 101 * @param t the exception to log, including its stack trace. 102 */ 103 void debug(Marker marker, String message, Throwable t); 104 105 /** 106 * Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level. 107 * 108 * @param msg the message string to be logged 109 */ 110 void debug(Message msg); 111 112 /** 113 * Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level. 114 * 115 * @param msg the message string to be logged 116 * @param t A Throwable or null. 117 */ 118 void debug(Message msg, Throwable t); 119 120 /** 121 * Logs a message object with the {@link Level#DEBUG DEBUG} level. 122 * 123 * @param message the message object to log. 124 */ 125 void debug(Object message); 126 127 /** 128 * Logs a message at the {@link Level#DEBUG DEBUG} level including the 129 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 130 * 131 * @param message the message to log. 132 * @param t the exception to log, including its stack trace. 133 */ 134 void debug(Object message, Throwable t); 135 136 /** 137 * Logs a message object with the {@link Level#DEBUG DEBUG} level. 138 * 139 * @param message the message object to log. 140 */ 141 void debug(String message); 142 143 /** 144 * Logs a message with parameters at the {@link Level#DEBUG DEBUG} level. 145 * @param message the message to log; the format depends on the message factory. 146 * @param params parameters to the message. 147 * @see #getMessageFactory() 148 */ 149 void debug(String message, Object... params); 150 151 /** 152 * Logs a message at the {@link Level#DEBUG DEBUG} level including the 153 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 154 * 155 * @param message the message to log. 156 * @param t the exception to log, including its stack trace. 157 */ 158 void debug(String message, Throwable t); 159 160 /** 161 * Logs entry to a method. 162 */ 163 void entry(); 164 165 /** 166 * Logs entry to a method. 167 * @param params The parameters to the method. 168 * @doubt Use of varargs results in array creation which can be a substantial portion of no-op case. 169 * LogMF/LogSF provides several overrides to avoid vararg except in edge cases. (RG) LogMF 170 * and LogSF implement these in LogXF which calls logger.callAppenders. callAppenders is 171 * part of the implementation and cannot be used by the API. Adding more methods here 172 * and in AbstractLogger is sufficient. 173 */ 174 void entry(Object... params); 175 176 /** 177 * Logs a message with the specific Marker at the {@link Level#ERROR ERROR} level. 178 * 179 * @param marker the marker data specific to this log statement 180 * @param msg the message string to be logged 181 */ 182 void error(Marker marker, Message msg); 183 184 /** 185 * Logs a message with the specific Marker at the {@link Level#ERROR ERROR} level. 186 * 187 * @param marker the marker data specific to this log statement 188 * @param msg the message string to be logged 189 * @param t A Throwable or null. 190 */ 191 void error(Marker marker, Message msg, Throwable t); 192 193 /** 194 * Logs a message object with the {@link Level#ERROR ERROR} level. 195 * 196 * @param marker the marker data specific to this log statement. 197 * @param message the message object to log. 198 */ 199 void error(Marker marker, Object message); 200 201 /** 202 * Logs a message at the {@link Level#ERROR ERROR} level including the 203 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 204 * 205 * @param marker the marker data specific to this log statement. 206 * @param message the message object to log. 207 * @param t the exception to log, including its stack trace. 208 */ 209 void error(Marker marker, Object message, Throwable t); 210 211 /** 212 * Logs a message object with the {@link Level#ERROR ERROR} level. 213 * 214 * @param marker the marker data specific to this log statement. 215 * @param message the message object to log. 216 */ 217 void error(Marker marker, String message); 218 219 /** 220 * Logs a message with parameters at the {@link Level#ERROR ERROR} level. 221 * @param marker the marker data specific to this log statement. 222 * @param message the message to log; the format depends on the message factory. 223 * @param params parameters to the message. 224 * @see #getMessageFactory() 225 * 226 * @doubt Likely to misinterpret existing log4j client code that intended to call 227 * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you 228 * meant error, not info. It isn't possible to be misinterpreted as the previous method 229 * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters. 230 */ 231 void error(Marker marker, String message, Object... params); 232 233 /** 234 * Logs a message at the {@link Level#ERROR ERROR} level including the 235 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 236 * 237 * @param marker the marker data specific to this log statement. 238 * @param message the message object to log. 239 * @param t the exception to log, including its stack trace. 240 */ 241 void error(Marker marker, String message, Throwable t); 242 243 /** 244 * Logs a message with the specific Marker at the {@link Level#ERROR ERROR} level. 245 * 246 * @param msg the message string to be logged 247 */ 248 void error(Message msg); 249 250 /** 251 * Logs a message with the specific Marker at the {@link Level#ERROR ERROR} level. 252 * 253 * @param msg the message string to be logged 254 * @param t A Throwable or null. 255 */ 256 void error(Message msg, Throwable t); 257 258 /** 259 * Logs a message object with the {@link Level#ERROR ERROR} level. 260 * 261 * @param message the message object to log. 262 */ 263 void error(Object message); 264 265 /** 266 * Logs a message at the {@link Level#ERROR ERROR} level including the 267 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 268 * 269 * @param message the message object to log. 270 * @param t the exception to log, including its stack trace. 271 */ 272 void error(Object message, Throwable t); 273 274 /** 275 * Logs a message object with the {@link Level#ERROR ERROR} level. 276 * 277 * @param message the message object to log. 278 */ 279 void error(String message); 280 281 /** 282 * Logs a message with parameters at the {@link Level#ERROR ERROR} level. 283 * 284 * @param message the message to log; the format depends on the message factory. 285 * @param params parameters to the message. 286 * @see #getMessageFactory() 287 * 288 * @doubt Likely to misinterpret existing log4j client code that intended to call 289 * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you 290 * meant error, not info. It isn't possible to be misinterpreted as the previous method 291 * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters. 292 */ 293 void error(String message, Object... params); 294 295 /** 296 * Logs a message at the {@link Level#ERROR ERROR} level including the 297 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 298 * 299 * @param message the message object to log. 300 * @param t the exception to log, including its stack trace. 301 */ 302 void error(String message, Throwable t); 303 304 /** 305 * Logs exit from a method. 306 */ 307 void exit(); 308 309 /** 310 * Logs exiting from a method with the result. This may be coded as <br /> 311 * return logger.exit(myResult); 312 * @param <R> The type of the parameter and object being returned. 313 * @param result The result being returned from the method call. 314 * @return the result. 315 */ 316 <R> R exit(R result); 317 318 /** 319 * Logs a message with the specific Marker at the {@link Level#FATAL FATAL} level. 320 * 321 * @param marker the marker data specific to this log statement 322 * @param msg the message string to be logged 323 */ 324 void fatal(Marker marker, Message msg); 325 326 /** 327 * Logs a message with the specific Marker at the {@link Level#FATAL FATAL} level. 328 * 329 * @param marker the marker data specific to this log statement 330 * @param msg the message string to be logged 331 * @param t A Throwable or null. 332 */ 333 void fatal(Marker marker, Message msg, Throwable t); 334 335 /** 336 * Logs a message object with the {@link Level#FATAL FATAL} level. 337 * 338 * @param marker The marker data specific to this log statement. 339 * @param message the message object to log. 340 */ 341 void fatal(Marker marker, Object message); 342 343 /** 344 * Logs a message at the {@link Level#FATAL FATAL} level including the 345 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 346 * 347 * @param marker The marker data specific to this log statement. 348 * @param message the message object to log. 349 * @param t the exception to log, including its stack trace. 350 */ 351 void fatal(Marker marker, Object message, Throwable t); 352 353 /** 354 * Logs a message object with the {@link Level#FATAL FATAL} level. 355 * 356 * @param marker The marker data specific to this log statement. 357 * @param message the message object to log. 358 */ 359 void fatal(Marker marker, String message); 360 361 /** 362 * Logs a message with parameters at the {@link Level#FATAL FATAL} level. 363 * 364 * @param marker The marker data specific to this log statement. 365 * @param message the message to log; the format depends on the message factory. 366 * @param params parameters to the message. 367 * @see #getMessageFactory() 368 * 369 * @doubt Likely to misinterpret existing log4j client code that intended to call 370 * info(Object,Throwable). Incurs array creation expense on every call.(RG) I assume you 371 * meant fatal, not info. It isn't possible to be misinterpreted as the previous method 372 * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters. 373 */ 374 void fatal(Marker marker, String message, Object... params); 375 376 /** 377 * Logs a message at the {@link Level#FATAL FATAL} level including the 378 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 379 * 380 * @param marker The marker data specific to this log statement. 381 * @param message the message object to log. 382 * @param t the exception to log, including its stack trace. 383 */ 384 void fatal(Marker marker, String message, Throwable t); 385 386 /** 387 * Logs a message with the specific Marker at the {@link Level#FATAL FATAL} level. 388 * 389 * @param msg the message string to be logged 390 */ 391 void fatal(Message msg); 392 393 /** 394 * Logs a message with the specific Marker at the {@link Level#FATAL FATAL} level. 395 * 396 * @param msg the message string to be logged 397 * @param t A Throwable or null. 398 */ 399 void fatal(Message msg, Throwable t); 400 401 /** 402 * Logs a message object with the {@link Level#FATAL FATAL} level. 403 * 404 * @param message the message object to log. 405 */ 406 void fatal(Object message); 407 408 /** 409 * Logs a message at the {@link Level#FATAL FATAL} level including the 410 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 411 * 412 * @param message the message object to log. 413 * @param t the exception to log, including its stack trace. 414 */ 415 void fatal(Object message, Throwable t); 416 417 /** 418 * Logs a message object with the {@link Level#FATAL FATAL} level. 419 * 420 * @param message the message object to log. 421 */ 422 void fatal(String message); 423 424 /** 425 * Logs a message with parameters at the {@link Level#FATAL FATAL} level. 426 * 427 * @param message the message to log; the format depends on the message factory. 428 * @param params parameters to the message. 429 * @see #getMessageFactory() 430 * 431 * @doubt Likely to misinterpret existing log4j client code that intended to call 432 * info(Object,Throwable). Incurs array creation expense on every call.(RG) I assume you 433 * meant fatal, not info. It isn't possible to be misinterpreted as the previous method 434 * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters. 435 */ 436 void fatal(String message, Object... params); 437 438 /** 439 * Logs a message at the {@link Level#FATAL FATAL} level including the 440 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 441 * 442 * @param message the message object to log. 443 * @param t the exception to log, including its stack trace. 444 */ 445 void fatal(String message, Throwable t); 446 447 /** 448 * Gets the logger name. 449 * 450 * @return the logger name. 451 */ 452 String getName(); 453 454 /** 455 * Logs a message with the specific Marker at the {@link Level#INFO INFO} level. 456 * 457 * @param marker the marker data specific to this log statement 458 * @param msg the message string to be logged 459 */ 460 void info(Marker marker, Message msg); 461 462 /** 463 * Logs a message with the specific Marker at the {@link Level#INFO INFO} level. 464 * 465 * @param marker the marker data specific to this log statement 466 * @param msg the message string to be logged 467 * @param t A Throwable or null. 468 */ 469 void info(Marker marker, Message msg, Throwable t); 470 /** 471 * Logs a message object with the {@link Level#INFO INFO} level. 472 * 473 * @param marker the marker data specific to this log statement 474 * @param message the message object to log. 475 */ 476 void info(Marker marker, Object message); 477 478 /** 479 * Logs a message at the {@link Level#INFO INFO} level including the 480 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 481 * 482 * @param marker the marker data specific to this log statement 483 * @param message the message object to log. 484 * @param t the exception to log, including its stack trace. 485 */ 486 void info(Marker marker, Object message, Throwable t); 487 488 /** 489 * Logs a message object with the {@link Level#INFO INFO} level. 490 * 491 * @param marker the marker data specific to this log statement 492 * @param message the message object to log. 493 */ 494 void info(Marker marker, String message); 495 496 /** 497 * Logs a message with parameters at the {@link Level#INFO INFO} level. 498 * 499 * @param marker the marker data specific to this log statement 500 * @param message the message to log; the format depends on the message factory. 501 * @param params parameters to the message. 502 * @see #getMessageFactory() 503 * 504 * @doubt Likely to misinterpret existing log4j client code that intended to call 505 * info(Object,Throwable). Incurs array creation expense on every call. (RG) It isn't 506 * possible to be misinterpreted as the previous method is for that signature. Methods 507 * should be added to avoid varargs for 1, 2 or 3 parameters. 508 */ 509 void info(Marker marker, String message, Object... params); 510 511 /** 512 * Logs a message at the {@link Level#INFO INFO} level including the 513 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 514 * 515 * @param marker the marker data specific to this log statement 516 * @param message the message object to log. 517 * @param t the exception to log, including its stack trace. 518 */ 519 void info(Marker marker, String message, Throwable t); 520 521 /** 522 * Logs a message with the specific Marker at the TRACE level. 523 * 524 * @param msg the message string to be logged 525 */ 526 void info(Message msg); 527 528 /** 529 * Logs a message with the specific Marker at the {@link Level#INFO INFO} level. 530 * 531 * @param msg the message string to be logged 532 * @param t A Throwable or null. 533 */ 534 void info(Message msg, Throwable t); 535 536 /** 537 * Logs a message object with the {@link Level#INFO INFO} level. 538 * 539 * @param message the message object to log. 540 */ 541 void info(Object message); 542 543 /** 544 * Logs a message at the {@link Level#INFO INFO} level including the 545 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 546 * 547 * @param message the message object to log. 548 * @param t the exception to log, including its stack trace. 549 */ 550 void info(Object message, Throwable t); 551 552 /** 553 * Logs a message object with the {@link Level#INFO INFO} level. 554 * 555 * @param message the message object to log. 556 */ 557 void info(String message); 558 559 /** 560 * Logs a message with parameters at the {@link Level#INFO INFO} level. 561 * 562 * @param message the message to log; the format depends on the message factory. 563 * @param params parameters to the message. 564 * @see #getMessageFactory() 565 * 566 * @doubt Likely to misinterpret existing log4j client code that intended to call 567 * info(Object,Throwable). Incurs array creation expense on every call. (RG) It isn't 568 * possible to be misinterpreted as the previous method is for that signature. Methods 569 * should be added to avoid varargs for 1, 2 or 3 parameters. 570 */ 571 void info(String message, Object... params); 572 573 /** 574 * Logs a message at the {@link Level#INFO INFO} level including the 575 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 576 * 577 * @param message the message object to log. 578 * @param t the exception to log, including its stack trace. 579 */ 580 void info(String message, Throwable t); 581 582 /** 583 * Checks whether this Logger is enabled for the {@link Level#DEBUG DEBUG} Level. 584 * 585 * @return boolean - {@code true} if this Logger is enabled for level 586 * DEBUG, {@code false} otherwise. 587 */ 588 boolean isDebugEnabled(); 589 590 /** 591 * Checks whether this Logger is enabled for the {@link Level#DEBUG DEBUG} Level. 592 * 593 * @param marker The marker data specific to this log statement. 594 * @return boolean - {@code true} if this Logger is enabled for level 595 * DEBUG, {@code false} otherwise. 596 */ 597 boolean isDebugEnabled(Marker marker); 598 599 /** 600 * Checks whether this Logger is enabled for the the given Level. 601 * <p> 602 * Note that passing in {@link Level#OFF OFF} always returns {@code true}. 603 * </p> 604 * @param level the level to check 605 * @return boolean - {@code true} if this Logger is enabled for level, {@code false} otherwise. 606 */ 607 boolean isEnabled(Level level); 608 609 /** 610 * Checks whether this Logger is enabled for the {@link Level#ERROR ERROR} Level. 611 * 612 * @return boolean - {@code true} if this Logger is enabled for level 613 * {@link Level#ERROR ERROR}, {@code false} otherwise. 614 */ 615 boolean isErrorEnabled(); 616 617 /** 618 * Checks whether this Logger is enabled for the {@link Level#ERROR ERROR} Level. 619 * 620 * @param marker The marker data specific to this log statement. 621 * @return boolean - {@code true} if this Logger is enabled for level 622 * {@link Level#ERROR ERROR}, {@code false} otherwise. 623 */ 624 boolean isErrorEnabled(Marker marker); 625 626 /** 627 * Checks whether this Logger is enabled for the {@link Level#FATAL FATAL} Level. 628 * 629 * @return boolean - {@code true} if this Logger is enabled for level 630 * {@link Level#FATAL FATAL}, {@code false} otherwise. 631 */ 632 boolean isFatalEnabled(); 633 634 /** 635 * Checks whether this Logger is enabled for the {@link Level#FATAL FATAL} Level. 636 * 637 * @param marker The marker data specific to this log statement. 638 * @return boolean - {@code true} if this Logger is enabled for level 639 * {@link Level#FATAL FATAL}, {@code false} otherwise. 640 */ 641 boolean isFatalEnabled(Marker marker); 642 643 /** 644 * Checks whether this Logger is enabled for the {@link Level#INFO INFO} Level. 645 * 646 * @return boolean - {@code true} if this Logger is enabled for level 647 * INFO, {@code false} otherwise. 648 */ 649 boolean isInfoEnabled(); 650 651 /** 652 * Checks whether this Logger is enabled for the {@link Level#INFO INFO} Level. 653 * 654 * @param marker The marker data specific to this log statement. 655 * @return boolean - {@code true} if this Logger is enabled for level 656 * INFO, {@code false} otherwise. 657 */ 658 boolean isInfoEnabled(Marker marker); 659 660 /** 661 * Checks whether this Logger is enabled for the {@link Level#TRACE TRACE} level. 662 * 663 * @return boolean - {@code true} if this Logger is enabled for level 664 * TRACE, {@code false} otherwise. 665 */ 666 boolean isTraceEnabled(); 667 668 /** 669 * Checks whether this Logger is enabled for the {@link Level#TRACE TRACE} level. 670 * 671 * @param marker The marker data specific to this log statement. 672 * @return boolean - {@code true} if this Logger is enabled for level 673 * TRACE, {@code false} otherwise. 674 */ 675 boolean isTraceEnabled(Marker marker); 676 677 /** 678 * Checks whether this Logger is enabled for the {@link Level#WARN WARN} Level. 679 * 680 * @return boolean - {@code true} if this Logger is enabled for level 681 * {@link Level#WARN WARN}, {@code false} otherwise. 682 */ 683 boolean isWarnEnabled(); 684 685 /** 686 * Checks whether this Logger is enabled for the {@link Level#WARN WARN} Level. 687 * 688 * @param marker The marker data specific to this log statement. 689 * @return boolean - {@code true} if this Logger is enabled for level 690 * {@link Level#WARN WARN}, {@code false} otherwise. 691 */ 692 boolean isWarnEnabled(Marker marker); 693 694 /** 695 * Logs an exception or error to be thrown. This may be coded as <br /> 696 * throw logger.throwing(debug, myException); 697 * @param <T> the Throwable type. 698 * @param level The logging Level. 699 * @param t The Throwable. 700 * @return the Throwable. 701 */ 702 <T extends Throwable> T throwing(Level level, T t); 703 704 /** 705 * Logs an exception or error to be thrown. This may be coded as <br /> 706 * throw logger.throwing(myException); 707 * 708 * @param <T> the Throwable type. 709 * @param t The Throwable. 710 * @return the Throwable. 711 */ 712 <T extends Throwable> T throwing(T t); 713 714 /** 715 * Logs a message with the specific Marker at the {@link Level#TRACE TRACE} level. 716 * 717 * @param marker the marker data specific to this log statement 718 * @param msg the message string to be logged 719 */ 720 void trace(Marker marker, Message msg); 721 722 /** 723 * Logs a message with the specific Marker at the {@link Level#TRACE TRACE} level. 724 * 725 * @param marker the marker data specific to this log statement 726 * @param msg the message string to be logged 727 * @param t A Throwable or null. 728 */ 729 void trace(Marker marker, Message msg, Throwable t); 730 731 /** 732 * Logs a message object with the {@link Level#TRACE TRACE} level. 733 * 734 * @param marker the marker data specific to this log statement 735 * @param message the message object to log. 736 */ 737 void trace(Marker marker, Object message); 738 739 /** 740 * Logs a message at the {@link Level#TRACE TRACE} level including the 741 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 742 * <p/> 743 * <p> 744 * See {@link #debug(String)} form for more detailed information. 745 * </p> 746 * 747 * @param marker the marker data specific to this log statement 748 * @param message the message object to log. 749 * @param t the exception to log, including its stack trace. 750 */ 751 void trace(Marker marker, Object message, Throwable t); 752 753 /** 754 * Logs a message object with the {@link Level#TRACE TRACE} level. 755 * 756 * @param marker the marker data specific to this log statement 757 * @param message the message object to log. 758 */ 759 void trace(Marker marker, String message); 760 761 /** 762 * Logs a message with parameters at the {@link Level#TRACE TRACE} level. 763 * 764 * @param marker the marker data specific to this log statement 765 * @param message the message to log; the format depends on the message factory. 766 * @param params parameters to the message. 767 * @see #getMessageFactory() 768 */ 769 void trace(Marker marker, String message, Object... params); 770 771 /** 772 * Logs a message at the {@link Level#TRACE TRACE} level including the 773 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 774 * <p/> 775 * <p> 776 * See {@link #debug(String)} form for more detailed information. 777 * </p> 778 * 779 * @param marker the marker data specific to this log statement 780 * @param message the message object to log. 781 * @param t the exception to log, including its stack trace. 782 */ 783 void trace(Marker marker, String message, Throwable t); 784 785 /** 786 * Logs a message with the specific Marker at the {@link Level#TRACE TRACE} level. 787 * 788 * @param msg the message string to be logged 789 */ 790 void trace(Message msg); 791 792 /** 793 * Logs a message with the specific Marker at the {@link Level#TRACE TRACE} level. 794 * 795 * @param msg the message string to be logged 796 * @param t A Throwable or null. 797 */ 798 void trace(Message msg, Throwable t); 799 800 /** 801 * Logs a message object with the {@link Level#TRACE TRACE} level. 802 * 803 * @param message the message object to log. 804 */ 805 void trace(Object message); 806 807 /** 808 * Logs a message at the {@link Level#TRACE TRACE} level including the 809 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 810 * <p/> 811 * <p> 812 * See {@link #debug(String)} form for more detailed information. 813 * </p> 814 * 815 * @param message the message object to log. 816 * @param t the exception to log, including its stack trace. 817 */ 818 void trace(Object message, Throwable t); 819 820 /** 821 * Logs a message object with the {@link Level#TRACE TRACE} level. 822 * 823 * @param message the message object to log. 824 */ 825 void trace(String message); 826 827 /** 828 * Logs a message with parameters at the {@link Level#TRACE TRACE} level. 829 * @param message the message to log; the format depends on the message factory. 830 * @param params parameters to the message. 831 * @see #getMessageFactory() 832 */ 833 void trace(String message, Object... params); 834 835 /** 836 * Logs a message at the {@link Level#TRACE TRACE} level including the 837 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 838 * <p/> 839 * <p> 840 * See {@link #debug(String)} form for more detailed information. 841 * </p> 842 * 843 * @param message the message object to log. 844 * @param t the exception to log, including its stack trace. 845 */ 846 void trace(String message, Throwable t); 847 848 /** 849 * Logs a message with the specific Marker at the {@link Level#WARN WARN} level. 850 * 851 * @param marker the marker data specific to this log statement 852 * @param msg the message string to be logged 853 */ 854 void warn(Marker marker, Message msg); 855 856 857 /** 858 * Logs a message with the specific Marker at the {@link Level#WARN WARN} level. 859 * 860 * @param marker the marker data specific to this log statement 861 * @param msg the message string to be logged 862 * @param t A Throwable or null. 863 */ 864 void warn(Marker marker, Message msg, Throwable t); 865 866 /** 867 * Logs a message object with the {@link Level#WARN WARN} level. 868 * 869 * @param marker the marker data specific to this log statement 870 * @param message the message object to log. 871 */ 872 void warn(Marker marker, Object message); 873 874 /** 875 * Logs a message at the {@link Level#WARN WARN} level including the 876 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 877 * 878 * @param marker the marker data specific to this log statement 879 * @param message the message object to log. 880 * @param t the exception to log, including its stack trace. 881 */ 882 void warn(Marker marker, Object message, Throwable t); 883 884 /** 885 * Logs a message object with the {@link Level#WARN WARN} level. 886 * 887 * @param marker the marker data specific to this log statement 888 * @param message the message object to log. 889 */ 890 void warn(Marker marker, String message); 891 892 /** 893 * Logs a message with parameters at the {@link Level#WARN WARN} level. 894 * 895 * @param marker the marker data specific to this log statement. 896 * @param message the message to log; the format depends on the message factory. 897 * @param params parameters to the message. 898 * @see #getMessageFactory() 899 * 900 * @doubt Likely to misinterpret existing log4j client code that intended to call 901 * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you 902 * meant warn, not info. It isn't possible to be misinterpreted as the previous method 903 * is for that signature.Methods should be added to avoid varargs for 1, 2 or 3 parameters. 904 */ 905 void warn(Marker marker, String message, Object... params); 906 907 /** 908 * Logs a message at the {@link Level#WARN WARN} level including the 909 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 910 * 911 * @param marker the marker data specific to this log statement 912 * @param message the message object to log. 913 * @param t the exception to log, including its stack trace. 914 */ 915 void warn(Marker marker, String message, Throwable t); 916 917 /** 918 * Logs a message with the specific Marker at the {@link Level#WARN WARN} level. 919 * 920 * @param msg the message string to be logged 921 */ 922 void warn(Message msg); 923 924 /** 925 * Logs a message with the specific Marker at the {@link Level#WARN WARN} level. 926 * 927 * @param msg the message string to be logged 928 * @param t A Throwable or null. 929 */ 930 void warn(Message msg, Throwable t); 931 932 /** 933 * Logs a message object with the {@link Level#WARN WARN} level. 934 * 935 * @param message the message object to log. 936 */ 937 void warn(Object message); 938 939 /** 940 * Logs a message at the {@link Level#WARN WARN} level including the 941 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 942 * 943 * @param message the message object to log. 944 * @param t the exception to log, including its stack trace. 945 */ 946 void warn(Object message, Throwable t); 947 948 /** 949 * Logs a message object with the {@link Level#WARN WARN} level. 950 * 951 * @param message the message object to log. 952 */ 953 void warn(String message); 954 955 /** 956 * Logs a message with parameters at the {@link Level#WARN WARN} level. 957 * @param message the message to log; the format depends on the message factory. 958 * @param params parameters to the message. 959 * @see #getMessageFactory() 960 * 961 * @doubt Likely to misinterpret existing log4j client code that intended to call 962 * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you 963 * meant warn, not info. It isn't possible to be misinterpreted as the previous method 964 * is for that signature.Methods should be added to avoid varargs for 1, 2 or 3 parameters. 965 */ 966 void warn(String message, Object... params); 967 968 /** 969 * Logs a message at the {@link Level#WARN WARN} level including the 970 * stack trace of the {@link Throwable} <code>t</code> passed as parameter. 971 * 972 * @param message the message object to log. 973 * @param t the exception to log, including its stack trace. 974 */ 975 void warn(String message, Throwable t); 976 977 /** 978 * Gets the message factory used to convert message Objects and Strings into actual log Messages. 979 * 980 * @return the message factory. 981 */ 982 MessageFactory getMessageFactory(); 983 }