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