Buggy code:
class SizeRotatingFileHandlerAdd implements ModelAddOperationHandler { static final SizeRotatingFileHandlerAdd INSTANCE = new SizeRotatingFileHandlerAdd ( ) ; static long DEFAULT_ROTATE_SIZE = ( 2L * 1024L ) * 1024L ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final ModelNode compensatingOperation = new ModelNode ( ) ; compensatingOperation . get ( OP_ADDR ) . set ( operation . require ( OP_ADDR ) ) ; compensatingOperation . get ( OP ) . set ( REMOVE ) ; final ModelNode subModel = context . getSubModel ( ) ; subModel . get ( CommonAttributes . AUTOFLUSH ) . set ( operation . get ( CommonAttributes . AUTOFLUSH ) ) ; subModel . get ( CommonAttributes . ENCODING ) . set ( operation . get ( CommonAttributes . ENCODING ) ) ; subModel . get ( CommonAttributes . FORMATTER ) . set ( operation . get ( CommonAttributes . FORMATTER ) ) ; subModel . get ( CommonAttributes . LEVEL ) . set ( operation . get ( CommonAttributes . LEVEL ) ) ; subModel . get ( CommonAttributes . FILE ) . set ( operation . get ( CommonAttributes . FILE ) ) ; subModel . get ( CommonAttributes . MAX_BACKUP_INDEX ) . set ( operation . get ( CommonAttributes . MAX_BACKUP_INDEX ) ) ; subModel . get ( CommonAttributes . ROTATE_SIZE ) . set ( operation . get ( CommonAttributes . ROTATE_SIZE ) ) ; if ( ( context . getRuntimeContext ( ) ) != null ) { context . getRuntimeContext ( ) . setRuntimeTask ( new RuntimeTask ( ) { public void execute ( RuntimeTaskContext context ) throws OperationFailedException { final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; try { final SizeRotatingFileHandlerService service = new SizeRotatingFileHandlerService ( ) ; final ServiceBuilder < Handler > serviceBuilder = serviceTarget . addService ( LogServices . handlerName ( name ) , service ) ; if ( operation . hasDefined ( CommonAttributes . FILE ) ) { final HandlerFileService fileService = new HandlerFileService ( operation . get ( CommonAttributes . FILE , CommonAttributes . PATH ) . asString ( ) ) ; final ServiceBuilder < ? > fileBuilder = serviceTarget . addService ( LogServices . handlerFileName ( name ) , fileService ) ; <START_BUG> if ( operation . hasDefined ( RELATIVE_TO ) ) { <END_BUG> fileBuilder . addDependency ( AbstractPathService . pathNameOf ( operation . get ( CommonAttributes . FILE , CommonAttributes . RELATIVE_TO ) . asString ( ) ) , String . class , fileService . getRelativeToInjector ( ) ) ; } fileBuilder . setInitialMode ( ACTIVE ) . install ( ) ; serviceBuilder . addDependency ( LogServices . handlerFileName ( name ) , String . class , service . getFileNameInjector ( ) ) ; } service . setLevel ( Level . parse ( operation . get ( CommonAttributes . LEVEL ) . asString ( ) ) ) ; final Boolean autoFlush = operation . get ( CommonAttributes . AUTOFLUSH ) . asBoolean ( ) ; if ( autoFlush != null ) service . setAutoflush ( autoFlush . booleanValue ( ) ) ; if ( operation . has ( CommonAttributes . ENCODING ) ) service . setEncoding ( operation . get ( CommonAttributes . ENCODING ) . asString ( ) ) ; if ( operation . has ( CommonAttributes . FORMATTER ) ) service . setFormatterSpec ( SizeRotatingFileHandlerAdd . createFormatterSpec ( operation ) ) ; if ( operation . has ( CommonAttributes . MAX_BACKUP_INDEX ) ) service . setMaxBackupIndex ( operation . get ( CommonAttributes . MAX_BACKUP_INDEX ) . asInt ( ) ) ; if ( operation . has ( CommonAttributes . ROTATE_SIZE ) ) service . setRotateSize ( operation . get ( CommonAttributes . ROTATE_SIZE ) . asLong ( SizeRotatingFileHandlerAdd . DEFAULT_ROTATE_SIZE ) ) ; serviceBuilder . setInitialMode ( ACTIVE ) ; serviceBuilder . install ( ) ; resultHandler . handleResultComplete ( ) ; } catch ( Throwable t ) { throw new OperationFailedException ( new ModelNode ( ) . set ( t . getLocalizedMessage ( ) ) ) ; } } } ) ; } else { resultHandler . handleResultComplete ( ) ; } return new org . jboss . as . controller . BasicOperationResult ( compensatingOperation ) ; } static AbstractFormatterSpec createFormatterSpec ( final ModelNode operation ) { } }

Fix:
if ( operation . get ( CommonAttributes . FILE ) . hasDefined ( RELATIVE_TO ) ) {